Completed
Push — master ( 9cccc5...d4b7f8 )
by Carsten
05:52 queued 10s
created

SpeedPoint::__debugInfo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
namespace FilmTools\SpeedPoint;
3
4
class SpeedPoint extends SpeedPointAbstract implements SpeedPointInterface, SpeedPointProviderInterface
5
{
6
7
    /**
8
     * @param float  $logH  Exposure value
9
     * @param string $type  Short description
10
     */
11 15
    public function __construct( ?float $logH, ?string $type = null)
12
    {
13 15
        $this->value = $logH;
14 15
        $this->type = $type;
15 15
    }
16
17
18
    /**
19
     * @inheritDoc
20
     */
21 6
    public function getSpeedPoint(): SpeedPointInterface
22
    {
23 6
        return $this;
24
    }
25
26
27 9
    public function __debugInfo() : array
28
    {
29
        return [
30 9
            'type'          => $this->type,
31 9
            'value'         => $this->value,
32 9
            'valid'         => $this->valid(),
33 9
            'speed_loss'    => $this->getSpeedLoss(),
34 9
            'ei_correction' => $this->getEICorrection()
35
        ];
36
    }
37
}
38