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

Collection   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 33
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getMeta() 0 3 1
A getEntries() 0 3 1
A fromArray() 0 5 1
1
<?php
2
declare(strict_types=1);
3
4
namespace SeamsCMS\Delivery\Model;
5
6
abstract class Collection
7
{
8
    use HydratorTrait {
9
        fromArray as private fromArrayTrait;
10
    }
11
12
    /** @var array */
13
    protected $entries;
14
15
    /** @var CollectionMeta */
16
    protected $meta;
17
18
    /**
19
     * @return array
20
     */
21
    public function getEntries(): array
22
    {
23
        return $this->entries;
24
    }
25
26
    /**
27
     * @return CollectionMeta
28
     */
29
    public function getMeta(): CollectionMeta
30
    {
31
        return $this->meta;
32
    }
33
34
    public static function fromArray(array $data)
35
    {
36
        $data['meta'] = CollectionMeta::fromArray($data['meta']);
37
38
        return self::fromArrayTrait($data);
39
    }
40
}
41