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

WorkspaceCollection   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 88.89%

Importance

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

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