Passed
Push — master ( 443842...86f0b2 )
by Joshua
05:55 queued 01:59
created

AssetCollection::fromArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 10
ccs 0
cts 9
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SeamsCMS\Delivery\Model;
6
7
class AssetCollection extends Collection
8
{
9
    public static function fromArray(array $data)
10
    {
11
        $data['entries'] = array_map(
12
            function ($item) {
13
                return Asset::fromArray($item);
14
            },
15
            $data['entries']
16
        );
17
18
        return parent::fromArray($data);
19
    }
20
}
21