Skip to content

Commit 251304e

Browse files
authored
[Validator] Use null coalescing operator instead of ternary operator
1 parent e6d543a commit 251304e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

validation/severity.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ method. Each constraint exposes the attached payload as a public property::
137137
// Symfony\Component\Validator\ConstraintViolation
138138
$constraintViolation = ...;
139139
$constraint = $constraintViolation->getConstraint();
140-
$severity = isset($constraint->payload['severity']) ? $constraint->payload['severity'] : null;
140+
$severity = $constraint->payload['severity'] ?? null;
141141

142142
For example, you can leverage this to customize the ``form_errors`` block
143143
so that the severity is added as an additional HTML class:

0 commit comments

Comments
 (0)