Dump   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 32
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A toArray() 0 9 1
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