Passed
Push — master ( c10be1...cb219e )
by Joshua
03:34 queued 11s
created

AssetCollection::getEntries()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
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 -SeamsCMSDeliverySdk 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 1
    public function getEntries(): array
29
    {
30 1
        return $this->entries;
31
    }
32
33
    /**
34
     * @param array $data
35
     * @return AssetCollection
36
     */
37 1
    public static function fromArray(array $data)
38
    {
39 1
        $data['entries'] = array_map(
40 1
            function ($item) {
41
                return Asset::fromArray($item);
42 1
            },
43 1
            $data['entries']
44
        );
45
46 1
        return parent::fromArray($data);
47
    }
48
}
49