Completed
Push — master ( 494025...63e9a9 )
by Joshua
14s queued 11s
created

ContentCollection   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getEntries() 0 3 1
A fromArray() 0 10 1
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 ContentCollection
18
 * @package SeamsCMS\Delivery\Model
19
 */
20
class ContentCollection extends Collection
21
{
22
    /** @var Content[] */
23
    protected $entries;
24
25
    /**
26
     * @return Content[]
27
     */
28 2
    public function getEntries(): array
29
    {
30 2
        return parent::getEntries();
31
    }
32
33
    /**
34
     * @param array $data
35
     * @return ContentCollection
36
     */
37 2
    public static function fromArray(array $data)
38
    {
39 2
        $data['entries'] = array_map(
40 2
            function ($item) {
41 1
                return Content::fromArray($item);
42 2
            },
43 2
            $data['entries']
44
        );
45
46 2
        return parent::fromArray($data);
47
    }
48
}
49