Length
class Length extends StringComparator (View source)
Check if the length of the input matches the min and max values.
If min and max are equal, the count must match that value regardless of the inclusive flag.
Traits
Methods
No description
Length must be between the given sizes.
Compare the input string against the comparator.
Length must be less than or equal to the given size.
Details
__construct(int $min = null, int $max = null, bool $inclusive = true)
No description
final bool
__invoke(mixed $value)
Compare the input value against the comparator.
static Length
between(int $min, int $max, bool $inclusive = true)
Length must be between the given sizes.
final bool
check(mixed $value)
Compare the input string against the comparator.
protected bool
checkString(string $value)
Compare the input string against the comparator.
static Length
equal(int $size)
Length must be equal to the given size.
static Length
make(int $min = null, int $max = null, bool $inclusive = true)
No description
static Length
max(int $max, bool $inclusive = true)
Length must be less than or equal to the given size.
static Length
min(int $min, bool $inclusive = true)
Length must be greater than or equal to the given size.
protected string
resolveStringInput(mixed $value)
No description