Completed
Push — master ( 13576f...97d117 )
by Joshua
09:01 queued 07:27
created

AssetCollection::getEntries()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the SeamsCMSDeliveryBundle 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
    public function getEntries(): array
29
    {
30
        return $this->entries;
31
    }
32
33
    /**
34
     * @param array $data
35
     * @return Collection
36
     */
37
    public static function fromArray(array $data)
38
    {
39
        $data['entries'] = array_map(
40
            function ($item) {
41
                return Asset::fromArray($item);
42
            },
43
            $data['entries']
44
        );
45
46
        return parent::fromArray($data);
47
    }
48
}
49