Passed
Push — master ( 6be800...01ae67 )
by
unknown
02:02
created

Collection   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 85
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 0
dl 0
loc 85
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
A getJsonapi() 0 4 1
A setJsonapi() 0 4 1
A getMeta() 0 4 1
A setMeta() 0 4 1
A getLinks() 0 4 1
A setLinks() 0 4 1
1
<?php
2
/*
3
 * This file is part of AppBundle the package.
4
 *
5
 * (c) Ruslan Muriev <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace RonteLtd\JsonApiBundle\Serializer\Normalizer;
12
13
use Doctrine\Common\Collections\ArrayCollection;
14
15
/**
16
 * Class Collection
17
 *
18
 * @package RonteLtd\JsonApiBundle\Serializer\Normalizer
19
 * @author Ruslan Muriev <[email protected]>
20
 */
21
class Collection extends ArrayCollection
22
{
23
    /**
24
     * JsonApi "jsonapi" example ["version" => "1.0"]
25
     *
26
     * @var array
27
     */
28
    protected $jsonapi = [];
29
30
    /**
31
     * JsonApi meta
32
     *
33
     * @var array
34
     */
35
    protected $meta = [];
36
37
    /**
38
     * JsonApi links
39
     *
40
     * @var array
41
     */
42
    protected $links = [];
43
44
    /**
45
     * Initializes a new ArrayCollection.
46
     *
47
     * @param $elements
48
     */
49
    public function __construct($elements = array())
50
    {
51
        if (!is_array($elements)) {
52
            $elements = [$elements];
53
        }
54
55
        parent::__construct($elements);
56
    }
57
58
    /**
59
     * @return array
60
     */
61
    public function getJsonapi()
62
    {
63
        return $this->jsonapi;
64
    }
65
66
    /**
67
     * @param array $jsonapi
68
     */
69
    public function setJsonapi($jsonapi)
70
    {
71
        $this->jsonapi = $jsonapi;
72
    }
73
74
    /**
75
     * @return array
76
     */
77
    public function getMeta()
78
    {
79
        return $this->meta;
80
    }
81
82
    /**
83
     * @param array $meta
84
     */
85
    public function setMeta($meta)
86
    {
87
        $this->meta = $meta;
88
    }
89
90
    /**
91
     * @return array
92
     */
93
    public function getLinks()
94
    {
95
        return $this->links;
96
    }
97
98
    /**
99
     * @param array $links
100
     */
101
    public function setLinks($links)
102
    {
103
        $this->links = $links;
104
    }
105
}