Skip to content

Commit e4ebd06

Browse files
author
Lucas Michot
committed
No need to declare a dumper so early.
1 parent d24b641 commit e4ebd06

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Dumper.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ public function __construct(Connection $connection)
2626
public function dump($value)
2727
{
2828
if (class_exists(CliDumper::class)) {
29-
$dumper = in_array(PHP_SAPI, ['cli', 'phpdbg']) ? new CliDumper : new HtmlDumper;
30-
3129
$data = (new VarCloner)->cloneVar($value);
3230

33-
if (!$this->connection || !$this->connection->write($data)) {
31+
if ($this->connection === null || $this->connection->write($data) === false) {
32+
$dumper = in_array(PHP_SAPI, ['cli', 'phpdbg']) ? new CliDumper : new HtmlDumper;
3433
$dumper->dump($data);
3534
}
3635
} else {

0 commit comments

Comments
 (0)