FilmSpeedAbstract   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 45
ccs 4
cts 8
cp 0.5
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDin() 0 4 1
A getAsa() 0 4 1
A getIso() 0 7 1
1
<?php
2
namespace FilmTools\FilmSpeed;
3
4
abstract class FilmSpeedAbstract implements FilmSpeedInterface
5
{
6
7
    /**
8
     * @var float
9
     */
10
    protected $din;
11
12
13
    /**
14
     * @var float
15
     */
16
    protected $asa;
17
18
19
    /**
20
     * @inheritDoc
21
     */
22 44
    public function getDin() : float
23
    {
24 44
        return $this->din;
25
    }
26
27
28
    /**
29
     * @inheritDoc
30
     */
31 44
    public function getAsa() : float
32
    {
33 44
        return $this->asa;
34
    }
35
36
37
    /**
38
     * @inheritDoc
39
     */
40
    public function getIso( ) : string
41
    {
42
        $din = $this->getDin( );
43
        $asa = $this->getAsa( );
44
45
        return sprintf("ISO %s/%s°", $asa, $din);
46
    }
47
48
}
49