FStops   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 37
ccs 8
cts 8
cp 1
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 ValuesIterator implements FStopsInterface, FStopsProviderInterface
6
{
7
    use SearchableTrait;
8
9
    public $unit = 'fstop';
10
11
    /**
12
     * @inheritDoc
13
     * @return $this
14
     */
15 9
    public function getFStops() : FStopsInterface
16
    {
17 9
        return $this;
18
    }
19
20
21
    /**
22
     * @inheritDoc
23
     */
24 18
    public function getZones() : ZonesInterface
25
    {
26 18
        $min = $this->min();
27
        return new Zones( array_map( function( $fstop ) use ($min) {
28 18
            return $fstop + ($min * -1);
29 18
        }, $this->getArrayCopy()));
30
    }
31
32
33
    /**
34
     * @inheritDoc
35
     * @return ExposuresInterface
36
     */
37 9
    public function getExposures() : ExposuresInterface
38
    {
39 9
        return $this->getZones()->getExposures();
40
    }
41
}
42