Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Validator][Choice] Fix callback option if not array or iterable returned#58611
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[Validator][Choice] Fix callback option if not array or iterable returned#58611
Uh oh!
There was an error while loading.Please reload this page.
Conversation
stof commentedOct 21, 2024
should we mention the name of the callable in the error message, to make it easier to debug ? |
symfonyaml commentedOct 21, 2024
@stof Thank you for your review. That's a good idea, I will add that the callable in the error message. |
… 3.0 when not in develop mode
Sincesymfony#54471, dumpFile will trigger a `fileperms(): stat failed`error when writing to a filename that does not yet exist. Thiswas silenced from PHP's default handler with the `@` operator.However, the error is still passed to any custom handler that theapplication has registered, and can therefore cause exceptions orspurious logging depending on the implementation of the handler.The better solution, which is consistent with all other calls tonative functions in this class, would be to use `self::box` tocatch and ignore the potential error so that it never leaksoutside this class.
This PR was squashed before being merged into the 7.2 branch.Discussion----------CS: clean some whitespaces/indentation| Q | A| ------------- | ---| Branch? | 7.2| Bug fix? | no| New feature? | no <!-- please update src/**/CHANGELOG.md files -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Issues | Fix CS| License | MITCommits-------d0f63b8 CS: clean some whitespaces/indentation
The changes done insymfony#58453 were not enough. Since the session name is usedas the cookie name it must not be the empty string.
The test name argument is mandatory since PHPUnit 10.
The former test implementation relied on the order in which tests areexecuted assuming that tests explicitly creating the schema were executedfirst. This assumption leads to test failures on PHPUnit 10+ were testsdefined in parent classes are run first where they were run later withPHPUnit 9.6.
Oracle converts all not quoted names to uppercase
symfonyaml commentedOct 21, 2024
I appliedthis from the doc |
symfonyaml commentedOct 21, 2024
stof commentedOct 21, 2024
@symfonyaml looks like you rebase on top of the latest 7.2 branch instead of the latest 5.4 branch (as your PR targets 5.4) |
…rned (symfonyaml)This PR was squashed before being merged into the 5.4 branch.Discussion----------[Validator] [Choice] Fix callback option if not array returned| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Issues |Fix#58610| License | MIT### IssueWhen using the Choice validator `callback` option, and the callback method provided does not return an array or iterable, it causes a PHP error.See all details and how to reproduce it in the issue#58610### SolutionIn this PR - Add some checks if the callback method provided returns an array or iterable - Add tests for exception and iterable________________**NOTE** : This PR replaces [the old one](#58611) _(I messed up with the branch rebase)_Commits-------02d2769 [Validator] [Choice] Fix callback option if not array returned
Issue
When using the Choice validator
callbackoption, and the callback method provided does not return an array or iterable, it causes a PHP error.See all details and how to reproduce it in the issue#58610
Solution
In this PR