Skip to content

Commit 56d2cd7

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: Simplify some code with null coalesce operator
2 parents 7ec82fa + 5a443a9 commit 56d2cd7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Dumper/AbstractDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function __construct($output = null, string $charset = null, int $flags =
6363
*/
6464
public function setOutput($output)
6565
{
66-
$prev = null !== $this->outputStream ? $this->outputStream : $this->lineDumper;
66+
$prev = $this->outputStream ?? $this->lineDumper;
6767

6868
if (\is_callable($output)) {
6969
$this->outputStream = null;

Dumper/HtmlDumper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function dump(Data $data, $output = null, array $extraDisplayOptions = []
148148
*/
149149
protected function getDumpHeader()
150150
{
151-
$this->headerIsDumped = null !== $this->outputStream ? $this->outputStream : $this->lineDumper;
151+
$this->headerIsDumped = $this->outputStream ?? $this->lineDumper;
152152

153153
if (null !== $this->dumpHeader) {
154154
return $this->dumpHeader;
@@ -946,7 +946,7 @@ protected function dumpLine(int $depth, bool $endOfValue = false)
946946
if (-1 === $this->lastDepth) {
947947
$this->line = sprintf($this->dumpPrefix, $this->dumpId, $this->indentPad).$this->line;
948948
}
949-
if ($this->headerIsDumped !== (null !== $this->outputStream ? $this->outputStream : $this->lineDumper)) {
949+
if ($this->headerIsDumped !== ($this->outputStream ?? $this->lineDumper)) {
950950
$this->line = $this->getDumpHeader().$this->line;
951951
}
952952

0 commit comments

Comments
 (0)