Skip to content

Consider option "allowEmptyString" in examples #13358

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

Merged
merged 1 commit into from
Mar 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion reference/constraints/Length.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ and "50", you might add the following:
* min = 2,
* max = 50,
* minMessage = "Your first name must be at least {{ limit }} characters long",
* maxMessage = "Your first name cannot be longer than {{ limit }} characters"
* maxMessage = "Your first name cannot be longer than {{ limit }} characters",
* allowEmptyString = false
* )
*/
protected $firstName;
Expand All @@ -59,6 +60,7 @@ and "50", you might add the following:
max: 50
minMessage: 'Your first name must be at least {{ limit }} characters long'
maxMessage: 'Your first name cannot be longer than {{ limit }} characters'
allowEmptyString: false

.. code-block:: xml

Expand All @@ -79,6 +81,7 @@ and "50", you might add the following:
<option name="maxMessage">
Your first name cannot be longer than {{ limit }} characters
</option>
<option name="allowEmptyString">false</option>
</constraint>
</property>
</class>
Expand All @@ -101,6 +104,7 @@ and "50", you might add the following:
'max' => 50,
'minMessage' => 'Your first name must be at least {{ limit }} characters long',
'maxMessage' => 'Your first name cannot be longer than {{ limit }} characters',
'allowEmptyString' => false,
]));
}
}
Expand Down