Skip to content

Commit fa9d19d

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: Simplify some code with null coalesce operator
2 parents 7d88cf2 + c3557b6 commit fa9d19d

File tree

5 files changed

+5
-9
lines changed

5 files changed

+5
-9
lines changed

Command/AssetsInstallCommand.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,6 @@ private function getPublicDirectory(ContainerInterface $container): string
274274

275275
$composerConfig = json_decode(file_get_contents($composerFilePath), true);
276276

277-
if (isset($composerConfig['extra']['public-dir'])) {
278-
return $composerConfig['extra']['public-dir'];
279-
}
280-
281-
return $defaultPublicDir;
277+
return $composerConfig['extra']['public-dir'] ?? $defaultPublicDir;
282278
}
283279
}

Console/Descriptor/JsonDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ protected function describeContainerAlias(Alias $alias, array $options = [], Con
136136

137137
protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
138138
{
139-
$this->writeData($this->getEventDispatcherListenersData($eventDispatcher, \array_key_exists('event', $options) ? $options['event'] : null), $options);
139+
$this->writeData($this->getEventDispatcherListenersData($eventDispatcher, $options['event'] ?? null), $options);
140140
}
141141

142142
protected function describeCallable($callable, array $options = [])

Console/Descriptor/MarkdownDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ protected function describeContainerEnvVars(array $envs, array $options = [])
286286

287287
protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
288288
{
289-
$event = \array_key_exists('event', $options) ? $options['event'] : null;
289+
$event = $options['event'] ?? null;
290290

291291
$title = 'Registered listeners';
292292
if (null !== $event) {

Console/Descriptor/TextDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ protected function describeContainerEnvVars(array $envs, array $options = [])
476476

477477
protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
478478
{
479-
$event = \array_key_exists('event', $options) ? $options['event'] : null;
479+
$event = $options['event'] ?? null;
480480

481481
if (null !== $event) {
482482
$title = sprintf('Registered Listeners for "%s" Event', $event);

Console/Descriptor/XmlDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ protected function describeContainerAlias(Alias $alias, array $options = [], Con
9090

9191
protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
9292
{
93-
$this->writeDocument($this->getEventDispatcherListenersDocument($eventDispatcher, \array_key_exists('event', $options) ? $options['event'] : null));
93+
$this->writeDocument($this->getEventDispatcherListenersDocument($eventDispatcher, $options['event'] ?? null));
9494
}
9595

9696
protected function describeCallable($callable, array $options = [])

0 commit comments

Comments
 (0)