Skip to content

Conversation

snoek09
Copy link

@snoek09 snoek09 commented Dec 3, 2016

This fixes #7171.

**type**: ``boolean`` **default**: ``false``
**type**: ``boolean`` **default**: ``true``

The validator will also check the type of the input value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make more sense to keep the current description? Or at least tell a bit about what "check the type" means?

this value is passed to as the third argument to the PHP :phpfunction:`in_array`
method when checking to see if a value is in the valid choices array.
Setting the strict option of the `Choice` Constraint to `false` has been
deprecated as of Symfony 3.2 and the option will be changed to `true` as of 4.0.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it's reStructed Text, you have to use double backticks for literals: ``true``

Also, I suggest removing the literal from "Choice constraint". Literals kinda break the read flow, which makes things a little harder to read.

Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

xabbuh added a commit that referenced this pull request Jan 10, 2017
…ek09) This PR was submitted for the master branch but it was merged into the 3.2 branch instead (closes #7214). Discussion ---------- make strict the default option for choice validation This fixes #7171. Commits ------- 89d402c strict default option for choice validation
xabbuh added a commit that referenced this pull request Jan 10, 2017
@xabbuh
Copy link
Member

xabbuh commented Jan 10, 2017

Thank you @snoek09. I have merged your PR into the 3.2. Afterwards, I realised that we shouldn't have changed the default value as it's just deprecated right now to set it to false, but the default value will stay untouched until Symfony 4.0. So I addressed this in 80eaad3.

@xabbuh xabbuh closed this Jan 10, 2017
xabbuh added a commit that referenced this pull request Jan 11, 2017
* 3.2: (22 commits) Rename "console tasks" to "console commands" [Workflow] Add tip for workflow configuration default values Reflect private to hidden renaming in the file name Reflect renaming from private to hidden Added an article about private console commands Updated the explanation about framework.ide [#7214] fix option's default value strict default option for choice validation Reworded the user checker aliases explanation Remove duplicate use operator [Fix][httpKernel] Wrong links [Fix][Console] Missing autoloading by Composer Revert "Fixed wrong inheritance information" [#7318] Removing unnecessary word Minor fixes Explain what is the Symfony Core team Added the references to security vulnerabilities discovered in 2016 Improve configuration example text indents update year in license template describe should have an 's' on the end ...
@snoek09 snoek09 deleted the 7171-choice-validation-strict-default branch April 13, 2018 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

5 participants