Skip to content

Commit 918a576

Browse files
javiereguiluzderrabus
authored andcommitted
Simplify some code with null coalesce operator
1 parent f9a064f commit 918a576

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Compiler/MergeExtensionConfigurationPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public function freezeAfterProcessing(Extension $extension, ContainerBuilder $co
143143
*/
144144
public function getEnvPlaceholders(): array
145145
{
146-
return null !== $this->processedEnvPlaceholders ? $this->processedEnvPlaceholders : parent::getEnvPlaceholders();
146+
return $this->processedEnvPlaceholders ?? parent::getEnvPlaceholders();
147147
}
148148

149149
public function getUnusedEnvPlaceholders(): array

ContainerBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1630,7 +1630,7 @@ private function callMethod($service, array $call, array &$inlineServices)
16301630
*/
16311631
private function shareService(Definition $definition, $service, ?string $id, array &$inlineServices)
16321632
{
1633-
$inlineServices[null !== $id ? $id : spl_object_hash($definition)] = $service;
1633+
$inlineServices[$id ?? spl_object_hash($definition)] = $service;
16341634

16351635
if (null !== $id && $definition->isShared()) {
16361636
$this->services[$id] = $service;

0 commit comments

Comments
 (0)