Dump::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 4
1
<?php
2
3
namespace Facade\Ignition\DumpRecorder;
4
5
class Dump
6
{
7
    /** @var string */
8
    protected $htmlDump;
9
10
    /** @var ?string */
11
    protected $file;
12
13
    /** @var ?int */
14
    protected $lineNumber;
15
16
    /** @var float */
17
    protected $microtime;
18
19
    public function __construct(string $htmlDump, ?string $file, ?int $lineNumber, ?float $microtime = null)
20
    {
21
        $this->htmlDump = $htmlDump;
22
        $this->file = $file;
23
        $this->lineNumber = $lineNumber;
24
        $this->microtime = $microtime ?? microtime(true);
25
    }
26
27
    public function toArray(): array
28
    {
29
        return [
30
            'html_dump' => $this->htmlDump,
31
            'file' => $this->file,
32
            'line_number' => $this->lineNumber,
33
            'microtime' => $this->microtime,
34
        ];
35
    }
36
}
37