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.

ErrorCollection::add()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 3
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 4
cp 0
crap 2
1
<?php
2
/**
3
 * @author  Alexander Getmanskii <[email protected]>
4
 * @package GetSky\ParserExpressions
5
 */
6
namespace GetSky\ParserExpressions;
7
8
/**
9
 * It is a collection of errors.
10
 */
11
class ErrorCollection implements ErrorCollectionInterface
12
{
13
    /**
14
     * @var array The array of errors.
15
     */
16
    protected $errors = [];
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function add(RuleInterface $rule, $index, $depth)
22
    {
23
        $this->errors[$depth][] = new ParsingError($rule, $index, $depth);
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function findMaxErrors()
30
    {
31
        ksort($this->errors);
32
        return reset($this->errors);
33
    }
34
35
    public function clear()
36
    {
37
        $this->errors = [];
38
    }
39
}
40