Skip to content

[Validator] Use single quotes for a string #14944

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
Feb 10, 2021
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
8 changes: 4 additions & 4 deletions validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ rules). In order to validate an object, simply map one or more constraints
to its class and then pass it to the ``validator`` service.

Behind the scenes, a constraint is simply a PHP object that makes an assertive
statement. In real life, a constraint could be: 'The cake must not be burned'.
statement. In real life, a constraint could be: ``'The cake must not be burned'``.
In Symfony, constraints are similar: they are assertions that a condition
is true. Given a value, a constraint will tell you if that value
adheres to the rules of the constraint.
Expand Down Expand Up @@ -342,7 +342,7 @@ literature genre mostly associated with the author, which can be set to either
{
/**
* @Assert\Choice(
* choices = { "fiction", "non-fiction" },
* choices = {"fiction", "non-fiction"},
* message = "Choose a valid genre."
* )
*/
Expand Down Expand Up @@ -509,7 +509,7 @@ of the form fields::
$builder
->add('myField', TextType::class, [
'required' => true,
'constraints' => [new Length(['min' => 3])]
'constraints' => [new Length(['min' => 3])],
])
;
}
Expand Down Expand Up @@ -606,7 +606,7 @@ class to have at least 3 characters.
$metadata->addPropertyConstraint('firstName', new Assert\NotBlank());
$metadata->addPropertyConstraint(
'firstName',
new Assert\Length(["min" => 3])
new Assert\Length(['min' => 3])
);
}
}
Expand Down