UserSortOperation   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A apply() 0 7 1
1
<?php
2
/**
3
 * File was created 06.05.2015 22:14
4
 *
5
 * @author Karsten J. Gerber <[email protected]>
6
 */
7
8
namespace PeekAndPoke\Component\Psi\Operation\FullSet;
9
10
use PeekAndPoke\Component\Psi\FullSetOperation;
11
use PeekAndPoke\Component\Psi\Operation\AbstractBinaryFunctionOperation;
12
13
/**
14
 * KeySortOperation
15
 *
16
 * @author Karsten J. Gerber <[email protected]>
17
 */
18
class UserSortOperation extends AbstractBinaryFunctionOperation implements FullSetOperation
19
{
20
    /**
21
     * {@inheritdoc}
22
     */
23 3
    public function apply(\Iterator $set)
24
    {
25 3
        $data = iterator_to_array($set);
26
27 3
        usort($data, $this->function);
28
29 3
        return new \ArrayIterator($data);
30
    }
31
}
32