Back to Validation

Space

docs/validators/Space.md

3.1.11.8 KB
Original Source
<!-- SPDX-License-Identifier: MIT SPDX-FileCopyrightText: (c) Respect Project Contributors SPDX-FileContributor: Alexandre Gomes Gaigalas <[email protected]> SPDX-FileContributor: Danilo Correa <[email protected]> SPDX-FileContributor: Henrique Moody <[email protected]> -->

Space

  • Space()
  • Space(string ...$additionalChars)

Validates whether the input contains only whitespaces characters.

php
v::space()->assert('    ');
// Validation passes successfully

Templates

Space::TEMPLATE_STANDARD

ModeTemplate
default{{subject}} must consist only of space characters
inverted{{subject}} must not consist only of space characters

Space::TEMPLATE_EXTRA

ModeTemplate
default{{subject}} must consist only of space characters or {{additionalChars}}
inverted{{subject}} must not consist only of space characters or {{additionalChars}}

Template placeholders

PlaceholderDescription
additionalCharsAdditional characters that are considered valid.
subjectThe validated input or the custom validator name (if specified).

Categorization

  • Strings

Changelog

VersionDescription
3.0.0Templates changed
0.5.0Created

See Also