Respect / Validation

The most awesome validation engine ever created for PHP
https://respect-validation.readthedocs.io
MIT License
5.76k stars 774 forks source link

IntVal rule throws E_DEPRECATED warning in PHP 8.1 #1373

Closed fabacino closed 2 years ago

fabacino commented 2 years ago

Calling ctype_digit with something other than a string is deprecated in PHP 8.1

❯ vendor/bin/phpunit tests/unit/Rules/IntValTest.php                                                                                                                                      
PHPUnit 9.5.10 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.1.0
Configuration: /home/www/validation/phpunit.xml.dist

.............
Deprecated: ctype_digit(): Argument of type stdClass will be interpreted as string in the future in /home/www/validation/library/Rules/IntVal.php on line 39
.
Deprecated: ctype_digit(): Argument of type array will be interpreted as string in the future in /home/www/validation/library/Rules/IntVal.php on line 39
.
Deprecated: ctype_digit(): Argument of type null will be interpreted as string in the future in /home/www/validation/library/Rules/IntVal.php on line 39
...
Deprecated: ctype_digit(): Argument of type float will be interpreted as string in the future in /home/www/validation/library/Rules/IntVal.php on line 39
..
Deprecated: ctype_digit(): Argument of type bool will be interpreted as string in the future in /home/www/validation/library/Rules/IntVal.php on line 39
.
Deprecated: ctype_digit(): Argument of type bool will be interpreted as string in the future in /home/www/validation/library/Rules/IntVal.php on line 39
...
Deprecated: ctype_digit(): Argument of type float will be interpreted as string in the future in /home/www/validation/library/Rules/IntVal.php on line 39
.                                         25 / 25 (100%)

Time: 00:00.012, Memory: 6.00 MB

OK (25 tests, 25 assertions)
alganet commented 2 years ago

Nice! Let's fix it.

I'm approving the CI runs on #1374 and reviewing the change (I'm a little rusty, might take one or two days). Let me know if I can help you with anything else!

nickl- commented 2 years ago

Fixed #1374