mirror of
https://github.com/Respect/Validation.git
synced 2026-03-18 08:09:51 +01:00
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.
15 lines
548 B
PHP
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
|