GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#42)
by Axel
02:15
created

PolicyRuleAttribute::addExtraData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace PhpAbac\Model;
4
5
class PolicyRuleAttribute
6
{
7
    /** @var PhpAbac\Model\AbstractAttribute **/
8
    protected $attribute;
9
    /** @var string **/
10
    protected $comparisonType;
11
    /** @var string **/
12
    protected $comparison;
13
    /** @var mixed **/
14
    protected $value;
15
    /** @var array **/
16
    protected $extraData;
17
18
    /**
19
     * @param \PhpAbac\Model\AbstractAttribute $attribute
20
     *
21
     * @return \PhpAbac\Model\PolicyRuleAttribute
22
     */
23 8
    public function setAttribute(AbstractAttribute $attribute)
24
    {
25 8
        $this->attribute = $attribute;
0 ignored issues
show
Documentation Bug introduced by
It seems like $attribute of type object<PhpAbac\Model\AbstractAttribute> is incompatible with the declared type object<PhpAbac\Model\Php...odel\AbstractAttribute> of property $attribute.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
26
27 8
        return $this;
28
    }
29
30
    /**
31
     * @return \PhpAbac\Model\AbstractAttribute
32
     */
33 8
    public function getAttribute()
34
    {
35 8
        return $this->attribute;
36
    }
37
38
    /**
39
     * @param string $comparisonType
40
     *
41
     * @return \PhpAbac\Model\PolicyRuleAttribute
42
     */
43 8
    public function setComparisonType($comparisonType)
44
    {
45 8
        $this->comparisonType = $comparisonType;
46
47 8
        return $this;
48
    }
49
50
    /**
51
     * @return string
52
     */
53 8
    public function getComparisonType()
54
    {
55 8
        return $this->comparisonType;
56
    }
57
58
    /**
59
     * @param string $comparison
60
     *
61
     * @return \PhpAbac\Model\PolicyRuleAttribute
62
     */
63 8
    public function setComparison($comparison)
64
    {
65 8
        $this->comparison = $comparison;
66
67 8
        return $this;
68
    }
69
70
    /**
71
     * @return string
72
     */
73 7
    public function getComparison()
74
    {
75 7
        return $this->comparison;
76
    }
77
78
    /**
79
     * @param mixed $value
80
     *
81
     * @return \PhpAbac\Model\PolicyRuleAttribute
82
     */
83 8
    public function setValue($value)
84
    {
85 8
        $this->value = $value;
86
87 8
        return $this;
88
    }
89
90
    /**
91
     * @return mixed
92
     */
93 8
    public function getValue()
94
    {
95 8
        return $this->value;
96
    }
97
    
98
    /**
99
     * @param array $extraData
100
     * @return \PhpAbac\Model\PolicyRuleAttribute
101
     */
102 2
    public function setExtraData($extraData) {
103 2
        $this->extraData = $extraData;
104
        
105 2
        return $this;
106
    }
107
    
108
    /**
109
     * @param string $key
110
     * @param string $value
111
     * @return \PhpAbac\Model\PolicyRuleAttribute
112
     */
113 1
    public function addExtraData($key, $value) {
114 1
        $this->extraData[$key] = $value;
115
        
116 1
        return $this;
117
    }
118
            
119
    /**
120
     * @param string $key
121
     * @return \PhpAbac\Model\PolicyRuleAttribute
122
     */
123 1
    public function removeExtraData($key) {
124 1
        if(isset($this->extraData[$key])) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space after IF keyword; 0 found
Loading history...
125 1
            unset($this->extraData[$key]);
126 1
        }
127 1
        return $this;
128
    }
129
    
130
    /**
131
     * @return array
132
     */
133 4
    public function getExtraData() {
134 4
        return $this->extraData;
135
    }
136
}
137