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.

AndRule::_applies()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 2
eloc 2
nc 2
nop 0
crap 2
1
<?php
2
namespace izzum\rules;
3
4
/**
5
 * When a rule is chained using the 'AND' operator both rules given in the
6
 * constructor should apply.
7
 *
8
 * @author Rolf Vreijdenberger
9
 * @author Richard Ruiter
10
 */
11
class AndRule extends Rule {
12
    /**
13
     *
14
     * @var Rule
15
     */
16
    private $original;
17
    /**
18
     *
19
     * @var Rule
20
     */
21
    private $other;
22
23
    /**
24
     *
25
     * @param Rule $original            
26
     * @param Rule $other            
27
     */
28 23
    public function __construct(Rule $original, Rule $other)
29
    {
30 23
        $this->original = $original;
31 23
        $this->other = $other;
32 23
    }
33
34 22
    protected function _applies()
35
    {
36 22
        return (boolean) $this->original->applies() && $this->other->applies();
37
    }
38
39
    /**
40
     *
41
     * @return string
42
     */
43 2
    public function toString()
44
    {
45
        // includes the namespace
46 2
        $original = $this->original->toString();
47 2
        $other = $this->other->toString();
48 2
        return "($original and $other)";
49
    }
50
51
    /**
52
     * Merge results
53
     *
54
     * @return array
55
     */
56 1
    public function getResults()
57
    {
58 1
        return array_merge($this->other->getResults(), $this->original->getResults());
59
    }
60
}
61