Test Setup Failed
Push — master ( 656577...88aaf0 )
by Carsten
03:37
created

FStops   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 77.78%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 35
ccs 7
cts 9
cp 0.7778
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFStops() 0 4 1
A getZones() 0 7 1
A getExposures() 0 4 1
1
<?php
2
namespace FilmTools\Commons;
3
4
5
class FStops extends MinMaxArrayIterator implements FStopsInterface, FStopsProviderInterface
6
{
7
    use SearchableTrait;
8
9
    /**
10
     * @inheritDoc
11
     * @return $this
12
     */
13
    public function getFStops() : FStopsInterface
14
    {
15
        return $this;
16
    }
17
18
19 12
    /**
20
     * @inheritDoc
21 12
     */
22
    public function getZones() : ZonesInterface
23
    {
24
        $min = $this->min();
25
        return new Zones( array_map( function( $fstop ) use ($min) {
26
            return $fstop + ($min * -1);
27
        }, $this->getArrayCopy()));
28 24
    }
29
30 24
31 6
    /**
32 24
     * @inheritDoc
33 24
     * @return ExposuresInterface
34
     */
35
    public function getExposures() : ExposuresInterface
36
    {
37
        return $this->getZones()->getExposures();
38
    }
39
}
40