Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8 Deprecation - Validate length on null float/decimal #136

Merged
merged 1 commit into from
Apr 29, 2024
Merged

PHP 8 Deprecation - Validate length on null float/decimal #136

merged 1 commit into from
Apr 29, 2024

Conversation

iricketson
Copy link

If your model contains a nullable float/decimal, and a null value is passed into the Doctrine_Validator::validateLength static method, the validator attempts to call abs on a null value, resulting in a PHP Deprecation Error:

PHP message: PHP Deprecated: abs(): Passing null to parameter #1 ($num) of type int|float is deprecated in /path/to/friendsofsymfony1/doctrine1/lib/Doctrine/Validator.php on line 100"

It seems that any value with a null value should pass this validator so this PR simply returns early if the value is null.

@thePanz thePanz merged commit a552724 into FriendsOfSymfony1:master Apr 29, 2024
5 checks passed
@thePanz
Copy link
Member

thePanz commented Apr 29, 2024

Thanks @iricketson @alquerci
Merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants