MetaTrait::getMeta()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
/*
4
 * This file is part of JSON-API.
5
 *
6
 * (c) Toby Zerner <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Tobscure\JsonApi;
13
14
trait MetaTrait
15
{
16
    /**
17
     * The meta data array.
18
     *
19
     * @var array
20
     */
21
    protected $meta;
22
23
    /**
24
     * Get the meta.
25
     *
26
     * @return array
27
     */
28
    public function getMeta()
29
    {
30
        return $this->meta;
31
    }
32
33
    /**
34
     * Set the meta data array.
35
     *
36
     * @param array $meta
37
     *
38
     * @return $this
39
     */
40
    public function setMeta(array $meta)
41
    {
42
        $this->meta = $meta;
43
44
        return $this;
45
    }
46
47
    /**
48
     * Add meta data.
49
     *
50
     * @param string $key
51
     * @param string $value
52
     *
53
     * @return $this
54
     */
55 6
    public function addMeta($key, $value)
56
    {
57 6
        $this->meta[$key] = $value;
58
59 6
        return $this;
60
    }
61
}
62