AssetCollection   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
c 2
b 0
f 0
dl 0
loc 27
ccs 9
cts 9
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fromArray() 0 10 1
A getEntries() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Seams-CMS Delivery SDK package.
7
 *
8
 * (c) Seams-CMS.com
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace SeamsCMS\Delivery\Model;
15
16
/**
17
 * Class AssetCollection
18
 * @package SeamsCMS\Delivery\Model
19
 */
20
class AssetCollection extends Collection
21
{
22
    /** @var Asset[] */
23
    protected $entries;
24
25
    /**
26
     * @return Asset[]
27
     */
28 2
    public function getEntries(): array
29
    {
30 2
        return $this->entries;
31
    }
32
33
    /**
34
     * @param array $data
35
     * @return AssetCollection
36
     */
37 2
    public static function fromArray(array $data)
38
    {
39 2
        $data['entries'] = array_map(
40 2
            function ($item) {
41 1
                return Asset::fromArray($item);
42 2
            },
43 2
            $data['entries']
44
        );
45
46 2
        return parent::fromArray($data);
47
    }
48
}
49