Completed
Push — master ( cd00c2...c10be1 )
by Joshua
13s queued 11s
created

Collection::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 0
dl 0
loc 2
ccs 0
cts 2
cp 0
crap 2
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 Collection
18
 * @package SeamsCMS\Delivery\Model
19
 */
20
abstract class Collection
21
{
22
    use HydratorTrait {
23
        fromArray as private fromArrayTrait;
24
    }
25
26
    /** @var array */
27
    protected $entries;
28
29
    /** @var CollectionMeta */
30
    protected $meta;
31
32
33
    /**
34
     * Collection constructor.
35
     *
36
     */
37
    protected function __construct()
38
    {
39
    }
40
41
    /**
42
     * @return array
43
     */
44
    public function getEntries(): array
45
    {
46
        return $this->entries;
47
    }
48
49
    /**
50
     * @return CollectionMeta
51
     */
52
    public function getMeta(): CollectionMeta
53
    {
54
        return $this->meta;
55
    }
56
57
    /**
58
     * @param array $data
59
     * @return mixed
60
     */
61
    public static function fromArray(array $data)
62
    {
63
        $data['meta'] = CollectionMeta::fromArray($data['meta']);
64
65
        return self::fromArrayTrait($data);
66
    }
67
}
68