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

fix(validation): ValidationException causes TypeError exception when called with $code=null #6375

Merged
merged 1 commit into from
May 21, 2024

Conversation

KernelMrex
Copy link
Contributor

@KernelMrex KernelMrex commented May 19, 2024

Q A
Branch? 3.3
Tickets
License MIT
Doc PR

After update to 3.3.3, ValidationException called in custom validators code may cause issued.

For example: If you previously used ValidationException with only 1st string argument, after migration to 3.3.3 backward backward compatibility is broken.

Failed asserting that exception of type "TypeError" matches expected exception
"ApiPlatform\Validator\Exception\ValidationException". Message was: "Exception::__construct(): Argument #2 ($code) must be of type int, null given" at
/app/vendor/api-platform/core/src/Validator/Exception/ValidationException.php:84

@KernelMrex
Copy link
Contributor Author

May I should add some tests to cover ValidationException constructor?

@soyuka
Copy link
Member

soyuka commented May 21, 2024

Nice thanks!

@soyuka soyuka merged commit 002d8e5 into api-platform:3.3 May 21, 2024
73 of 76 checks passed
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.

2 participants