Skip to content

Commit b6b6d4c

Browse files
committed
CS: Apply ternary_to_null_coalescing fixer
1 parent 1a8f0d3 commit b6b6d4c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private function findAndSortTags(string $tagName, ContainerBuilder $container):
134134

135135
foreach ($container->findTaggedServiceIds($tagName, true) as $serviceId => $tags) {
136136
foreach ($tags as $attributes) {
137-
$priority = isset($attributes['priority']) ? $attributes['priority'] : 0;
137+
$priority = $attributes['priority'] ?? 0;
138138
$sortedTags[$priority][] = [$serviceId, $attributes];
139139
}
140140
}

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
}
166166

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

170170
$this->context->buildViolation($constraint->message)
171171
->atPath($errorPath)

0 commit comments

Comments
 (0)