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
506 B
PHP
15 lines
506 B
PHP
--FILE--
|
|
<?php
|
|
|
|
require 'vendor/autoload.php';
|
|
|
|
exceptionMessage(static fn() => v::languageCode()->assert(null));
|
|
exceptionMessage(static fn() => v::not(v::languageCode())->assert('pt'));
|
|
exceptionFullMessage(static fn() => v::languageCode()->assert('por'));
|
|
exceptionFullMessage(static fn() => v::not(v::languageCode())->assert('en'));
|
|
?>
|
|
--EXPECT--
|
|
`null` must be a valid language code
|
|
"pt" must not be a valid language code
|
|
- "por" must be a valid language code
|
|
- "en" must not be a valid language code
|