Passed
Pull Request — master (#225)
by Dmitriy
02:30
created

VarDumperHandler::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Debug\DebugServer;
6
7
use Yiisoft\VarDumper\HandlerInterface;
8
use Yiisoft\VarDumper\VarDumper;
9
10
final class VarDumperHandler implements HandlerInterface
11
{
12
    public Connection $connection;
13
14
    public function __construct()
15
    {
16
        $this->connection = Connection::create();
17
    }
18
19
    public function handle(mixed $variable, int $depth, bool $highlight = false): void
20
    {
21
        $this->connection->broadcast(Connection::MESSAGE_TYPE_VAR_DUMPER, VarDumper::create($variable)->asJson(false));
22
    }
23
}
24