Passed
Push — master ( 443842...86f0b2 )
by Joshua
05:55 queued 01:59
created

WorkspaceCollection   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 23
ccs 0
cts 13
cp 0
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
declare(strict_types=1);
3
4
namespace SeamsCMS\Delivery\Model;
5
6
class WorkspaceCollection extends Collection
7
{
8
    /** @var WorkspaceCollectionEntry[] */
9
    protected $entries;
10
11
    /**
12
     * @return WorkspaceCollectionEntry[]
13
     */
14
    public function getEntries(): array
15
    {
16
        return $this->entries;
17
    }
18
19
    public static function fromArray(array $data)
20
    {
21
        $data['entries'] = array_map(
22
            function ($item) {
23
                return WorkspaceCollectionEntry::fromArray($item);
24
            },
25
            $data['entries']
26
        );
27
28
        return parent::fromArray($data);
29
    }
30
}
31