Skip to content

Commit 83a77c4

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: Simplify some code with null coalesce operator
2 parents f0ba020 + bd7bcf5 commit 83a77c4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ContainerAwareEventManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function dispatchEvent($eventName, EventArgs $eventArgs = null)
5454
return;
5555
}
5656

57-
$eventArgs = null === $eventArgs ? EventArgs::getEmptyInstance() : $eventArgs;
57+
$eventArgs = $eventArgs ?? EventArgs::getEmptyInstance();
5858

5959
if (!isset($this->initialized[$eventName])) {
6060
$this->initializeListeners($eventName);

Validator/Constraints/UniqueEntityValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public function validate($entity, Constraint $constraint)
165165
return;
166166
}
167167

168-
$errorPath = null !== $constraint->errorPath ? $constraint->errorPath : $fields[0];
168+
$errorPath = $constraint->errorPath ?? $fields[0];
169169
$invalidValue = $criteria[$errorPath] ?? $criteria[$fields[0]];
170170

171171
$this->context->buildViolation($constraint->message)

0 commit comments

Comments
 (0)