Completed
Push — master ( ac0544...a10425 )
by Nate
11:46 queued 42s
created

SimpleCollection   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 23
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 14 2
1
<?php
2
3
/**
4
 * @author    Flipbox Factory
5
 * @copyright Copyright (c) 2017, Flipbox Digital
6
 * @link      https://github.com/flipbox/transform/releases/latest
7
 * @license   https://github.com/flipbox/transform/blob/master/LICENSE
8
 */
9
10
namespace Flipbox\Transform\Resources;
11
12
use ArrayIterator;
13
14
/**
15
 * @author Flipbox Factory <[email protected]>
16
 * @since 3.0.0
17
 *
18
 * @property array|ArrayIterator $data
19
 */
20
class SimpleCollection extends SimpleItem
21
{
22
    /**
23
     * @param callable $transformer
24
     * @param $data
25
     * @param array $extra
26
     * @return array|null
27
     */
28
    public function transform(callable $transformer, $data, array $extra = [])
29
    {
30
        $items = [];
31
32
        foreach ($data as $item) {
33
            $items[] = parent::transform(
34
                $transformer,
35
                $item,
36
                $extra
37
            );
38
        }
39
40
        return $items;
41
    }
42
}
43