Skip to content

Commit 63a32e2

Browse files
Use ??= more
1 parent 4646300 commit 63a32e2

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

DataCollector/DoctrineDataCollector.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,7 @@ private function sanitizeQuery(string $connectionName, array $query): array
176176
{
177177
$query['explainable'] = true;
178178
$query['runnable'] = true;
179-
if (null === $query['params']) {
180-
$query['params'] = [];
181-
}
179+
$query['params'] ??= [];
182180
if (!\is_array($query['params'])) {
183181
$query['params'] = [$query['params']];
184182
}

Form/Type/DoctrineType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,6 @@ private function getCachedEntityLoader(ObjectManager $manager, object $queryBuil
258258
{
259259
$hash = CachingFactoryDecorator::generateHash($vary);
260260

261-
return $this->entityLoaders[$hash] ?? ($this->entityLoaders[$hash] = $this->getLoader($manager, $queryBuilder, $class));
261+
return $this->entityLoaders[$hash] ??= $this->getLoader($manager, $queryBuilder, $class);
262262
}
263263
}

0 commit comments

Comments
 (0)