Exposures::getRange()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
namespace FilmTools\Commons;
3
4
5
class Exposures extends ValuesIterator implements ExposuresInterface, ExposuresProviderInterface
6
{
7
8
    use SearchableTrait;
9
10
    public $unit = 'logH';
11
12
    /**
13
     * @inheritDoc
14
     * @return $this
15
     */
16
    public function getExposures() : ExposuresInterface
17
    {
18
        return $this;
19
    }
20
21
    /**
22
     * @inheritDoc
23
     *
24
     * The range step width used here is a third of `log10(2) = 0.301...`.
25
     * The numbers will most likely cleanly round to multiples of 0.1 though.
26
     */
27 6
    public function getRange( float $step = null) : \SplFixedArray
28
    {
29 6
        $step = is_null($step) ? (log10(2) / 3) : $step;
30 6
        return parent::getRange( $step );
31
    }
32
33
}
34