-
Notifications
You must be signed in to change notification settings - Fork 2
Set
Pieter Hordijk edited this page Jan 1, 2019
·
1 revision
Validates the input (mixed
) to contain a countable value.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\Set\Countable;
(new Countable())->validate(['foo', 'bar']);
-
Set.Countable
when the validated value is not countable
Validates the input (countable
) to be within minimum length (int
) and maximum length (int
) inclusive.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\Set\LengthRange;
(new LengthRange(1, 10))->validate(['foo', 'bar']);
-
Set.Countable
when the validated value is not countable -
Set.MinimumLength
when the countable list contains less items than minimum -
Set.MaximumLength
when the countable list contains more items than maximum
Validates the input (countable
) to contain more than or exactly minimum length (int
) number of items.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\Set\MinimumLength;
(new MinimumLength(1))->validate(['foo', 'bar']);
-
Set.Countable
when the validated value is not countable -
Set.MinimumLength
when the countable list contains less items than minimum
Validates the input (countable
) to contain less than or exactly maximum length (int
) number of items.
Available since: 1.0.0
<?php declare(strict_types);
use HarmonyIO\Validation\Rule\Set\MaximumLength;
(new MaximumLength(10))->validate(['foo', 'bar']);
-
Set.Countable
when the validated value is not countable -
Set.MaximumLength
when the countable list contains more items than maximum