Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor #30442 [OptionsResolver] Fix an error message to be more accura…
…te (dimabory) This PR was merged into the 3.4 branch. Discussion ---------- [OptionsResolver] Fix an error message to be more accurate | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #30432 | License | MIT | Doc PR | See #30432 for more details: > **Symfony version(s) affected**: 3.4, maybe other versions too (not tested) > > **Description** > Error message when allowedTypes is an array contains `[]` but should not: > `The option "testme" with value array is expected to be of type "string[]", but one of the elements is of type "integer[]".` > It should be: > `The option "testme" with value array is expected to be of type "string[]", but one of the elements is of type "integer".` > > **How to reproduce** > > ``` > $resolver = (new OptionsResolver()) > ->setDefault('testme', []) > ->setAllowedTypes('testme', ['string[]']) > ->resolve(['testme' => ['test', 12]]); > ``` In addition I changed an error message to be more accurate if provided more than one incorrect value: > [...] is expected to be of type "integer[][]", but is of type "integer|boolean|string". Commits ------- 7fa2fc2 #30432 fix an error message
- Loading branch information
Showing
2 changed files
with
38 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters