SpeedPoint   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 37
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getSpeedPoint() 0 4 1
A __debugInfo() 0 10 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