Skip to content

Commit 24ceaa8

Browse files
authored
Merge pull request #19 from lucasmichot/feature/dumper-useless-construct
No need to declare a dumper so early.
2 parents 8bad473 + e4ebd06 commit 24ceaa8

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
@@ -36,11 +36,10 @@ public function __construct(Connection $connection = null)
3636
public function dump($value)
3737
{
3838
if (class_exists(CliDumper::class)) {
39-
$dumper = in_array(PHP_SAPI, ['cli', 'phpdbg']) ? new CliDumper : new HtmlDumper;
40-
4139
$data = (new VarCloner)->cloneVar($value);
4240

43-
if (!$this->connection || !$this->connection->write($data)) {
41+
if ($this->connection === null || $this->connection->write($data) === false) {
42+
$dumper = in_array(PHP_SAPI, ['cli', 'phpdbg']) ? new CliDumper : new HtmlDumper;
4443
$dumper->dump($data);
4544
}
4645
} else {

0 commit comments

Comments
 (0)