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.

PolicyRule::getPolicyRuleAttributes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace PhpAbac\Model;
4
5
class PolicyRule
6
{
7
    /** @var string **/
8
    protected $name;
9
    /** @var array<PhpAbac\Model\PolicyRuleAttribute> **/
10
    protected $policyRuleAttributes;
11
12 6
    public function __construct()
13
    {
14 6
        $this->policyRuleAttributes = [];
15 6
    }
16
17
    /**
18
     * @param string $name
19
     *
20
     * @return \PhpAbac\Model\PolicyRule
21
     */
22 6
    public function setName($name)
23
    {
24 6
        $this->name = $name;
25
26 6
        return $this;
27
    }
28
29
    /**
30
     * @return string
31
     */
32 2
    public function getName()
33
    {
34 2
        return $this->name;
35
    }
36
37
    /**
38
     * @param PolicyRuleAttribute $pra
39
     *
40
     * @return \PhpAbac\Model\PolicyRule
41
     */
42 6
    public function addPolicyRuleAttribute(PolicyRuleAttribute $pra)
43
    {
44 6
        if (!in_array($pra, $this->policyRuleAttributes, true)) {
45 6
            $this->policyRuleAttributes[] = $pra;
46 6
        }
47
48 6
        return $this;
49
    }
50
51
    /**
52
     * @param PolicyRuleAttribute $pra
53
     *
54
     * @return \PhpAbac\Model\PolicyRule
55
     */
56 1
    public function removePolicyRuleAttribute(PolicyRuleAttribute $pra)
57
    {
58 1
        if (($key = array_search($pra, $this->policyRuleAttributes)) !== false) {
59 1
            unset($this->policyRuleAttributes[$key]);
60 1
        }
61
62 1
        return $this;
63
    }
64
65
    /**
66
     * @return \PhpAbac\Model\PolicyRuleAttribute[]
67
     */
68 6
    public function getPolicyRuleAttributes()
69
    {
70 6
        return $this->policyRuleAttributes;
71
    }
72
}
73