respect-validation/tests/integration/rules/arrayVal.phpt
Henrique Moody a974c0c834
Run PHPStan in PHPT files
We were not running PHPStan on those files because of the strict types
declaration. However, I decided it would be better not to have strict
types on those files than not to run PHPStan issues.

Not surprisingly, there were several issues. Some issues were impacting
how user-friendly the library is.
2024-11-29 01:39:41 +01:00

15 lines
548 B
PHP

--FILE--
<?php
require 'vendor/autoload.php';
exceptionMessage(static fn() => v::arrayVal()->assert('Bla %123'));
exceptionMessage(static fn() => v::not(v::arrayVal())->assert([42]));
exceptionFullMessage(static fn() => v::arrayVal()->assert(new stdClass()));
exceptionFullMessage(static fn() => v::not(v::arrayVal())->assert(new ArrayObject([2, 3])));
?>
--EXPECT--
"Bla %123" must be an array value
`[42]` must not be an array value
- `stdClass {}` must be an array value
- `ArrayObject { getArrayCopy() => [2, 3] }` must not be an array value