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

make strict the default option for choice validation #7214

Closed
wants to merge 1 commit into from
Closed

make strict the default option for choice validation #7214

wants to merge 1 commit into from

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add docs for making strict the default option for choice validation
5 participants