MinOperation   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 3
dl 0
loc 12
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A apply() 0 5 2
1
<?php
2
/**
3
 * File was created 07.05.2015 09:11
4
 *
5
 * @author Karsten J. Gerber <[email protected]>
6
 */
7
8
namespace PeekAndPoke\Component\Psi\Operation\Terminal;
9
10
use PeekAndPoke\Component\Psi\TerminalOperation;
11
12
/**
13
 * MinOperation
14
 *
15
 * @author Karsten J. Gerber <[email protected]>
16
 */
17
class MinOperation implements TerminalOperation
18
{
19
    /**
20
     * {@inheritdoc}
21
     *
22
     * @return float
23
     */
24 1
    public function apply(\Iterator $set)
25
    {
26 1
        $data = iterator_to_array($set);
27
28 1
        return count($data) > 0 ? min($data) : 0;
29
    }
30
}
31