SpeedPoint::getSpeedPoint()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
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
    /**
28
     * @return mixed[]
29
     */
30 9
    public function __debugInfo() : array
31 9
    {
32 9
        return [
33 9
            'type'          => $this->type,
34 9
            'value'         => $this->value,
35
            'valid'         => $this->valid(),
36
            'speed_loss'    => $this->getSpeedLoss(),
37
            'ei_correction' => $this->getEICorrection()
38
        ];
39
    }
40
}
41