Skip to content

Commit 6d39bab

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: Simplify some code with null coalesce operator
2 parents 7a36248 + 6dfb6c5 commit 6d39bab

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

EventListener/DebugHandlersListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function __construct(callable $exceptionHandler = null, LoggerInterface $
5858

5959
$this->exceptionHandler = $exceptionHandler;
6060
$this->logger = $logger;
61-
$this->levels = null === $levels ? \E_ALL : $levels;
61+
$this->levels = $levels ?? \E_ALL;
6262
$this->throwAt = \is_int($throwAt) ? $throwAt : (null === $throwAt ? null : ($throwAt ? \E_ALL : null));
6363
$this->scream = $scream;
6464
$this->fileLinkFormat = $fileLinkFormat;

Profiler/Profile.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,7 @@ public function setUrl(?string $url)
141141
*/
142142
public function getTime()
143143
{
144-
if (null === $this->time) {
145-
return 0;
146-
}
147-
148-
return $this->time;
144+
return $this->time ?? 0;
149145
}
150146

151147
public function setTime(int $time)

Tests/KernelTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ protected function getBundle($dir = null, $parent = null, $className = null, $bu
632632
$bundle
633633
->expects($this->any())
634634
->method('getName')
635-
->willReturn(null === $bundleName ? \get_class($bundle) : $bundleName)
635+
->willReturn($bundleName ?? \get_class($bundle))
636636
;
637637

638638
$bundle

0 commit comments

Comments
 (0)