Skip to content

Commit 43aabe8

Browse files
committed
Merge branch '5.2' into 5.3
* 5.2: Simplify some code with null coalesce operator Don't use deprecated TestLogger class
2 parents cfe4c10 + 6d39bab commit 43aabe8

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
@@ -60,7 +60,7 @@ public function __construct(callable $exceptionHandler = null, LoggerInterface $
6060

6161
$this->exceptionHandler = $exceptionHandler;
6262
$this->logger = $logger;
63-
$this->levels = null === $levels ? \E_ALL : $levels;
63+
$this->levels = $levels ?? \E_ALL;
6464
$this->throwAt = \is_int($throwAt) ? $throwAt : (null === $throwAt ? null : ($throwAt ? \E_ALL : null));
6565
$this->scream = $scream;
6666
$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
@@ -640,7 +640,7 @@ protected function getBundle($dir = null, $parent = null, $className = null, $bu
640640
$bundle
641641
->expects($this->any())
642642
->method('getName')
643-
->willReturn(null === $bundleName ? \get_class($bundle) : $bundleName)
643+
->willReturn($bundleName ?? \get_class($bundle))
644644
;
645645

646646
$bundle

0 commit comments

Comments
 (0)