Completed
Push — master ( a787fa...dc9af5 )
by Vincent
05:35
created

HasMeta   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 1
b 0
f 0
dl 0
loc 34
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addToMeta() 0 5 1
A setMeta() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VGirol\JsonApiAssert\Factory;
6
7
trait HasMeta
8
{
9
    /**
10
     * Undocumented variable
11
     *
12
     * @var array
13
     */
14
    public $meta;
15
16
    /**
17
     * Undocumented function
18
     *
19
     * @param array $meta
20
     * @return static
21
     */
22
    public function setMeta(array $meta)
23
    {
24
        $this->meta = $meta;
25
26
        return $this;
27
    }
28
29
    /**
30
     * Undocumented function
31
     *
32
     * @param string $name
33
     * @param mixed $value
34
     * @return static
35
     */
36
    public function addToMeta(string $name, $value)
37
    {
38
        $this->addToObject('meta', $name, $value);
0 ignored issues
show
Bug introduced by
It seems like addToObject() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

38
        $this->/** @scrutinizer ignore-call */ 
39
               addToObject('meta', $name, $value);
Loading history...
39
40
        return $this;
41
    }
42
}
43