MetaTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 37.5%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 48
ccs 3
cts 8
cp 0.375
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getMeta() 0 4 1
A setMeta() 0 6 1
A addMeta() 0 6 1
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