mirror of
https://github.com/Respect/Validation.git
synced 2024-06-29 10:40:24 +02:00
20 lines
537 B
Plaintext
20 lines
537 B
Plaintext
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
require 'vendor/autoload.php';
|
||
|
|
||
|
use Respect\Validation\Validator as v;
|
||
|
|
||
|
exceptionMessage(static fn() => v::iterableVal()->check(3));
|
||
|
exceptionMessage(static fn() => v::not(v::iterableVal())->check([2, 3]));
|
||
|
exceptionFullMessage(static fn() => v::iterableVal()->assert('String'));
|
||
|
exceptionFullMessage(static fn() => v::not(v::iterableVal())->assert(new stdClass()));
|
||
|
?>
|
||
|
--EXPECT--
|
||
|
3 must be iterable
|
||
|
`[2, 3]` must not be iterable
|
||
|
- "String" must be iterable
|
||
|
- `stdClass {}` must not be iterable
|