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.

Analyzer::analyze()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 8
nc 2
nop 2
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Inspector\Analysis;
4
5
use PhpParser\Parser;
6
use Inspector\Analysis\Result\Issue;
7
use Inspector\Filesystem\SourceIterator;
8
use Inspector\Analysis\Result\AnalyzedFile;
9
use Inspector\Foundation\MessageProviderAwareTrait;
10
use Inspector\Foundation\MessageProviderAwareInterface;
11
12
/**
13
 * @author Kabir Baidhya
14
 */
15
class Analyzer implements MessageProviderAwareInterface
16
{
17
18
    use MessageProviderAwareTrait;
19
20
    /**
21
     * @var Parser
22
     */
23
    protected $parser;
24
25
    /**
26
     * @var FlawDetector
27
     */
28
    protected $flawDetector;
29
30
    /**
31
     * @param Parser $parser
32
     * @param FlawDetector $flawDetector
33
     */
34
    public function __construct(Parser $parser, FlawDetector $flawDetector)
35
    {
36
        $this->parser = $parser;
37
        $this->flawDetector = $flawDetector;
38
    }
39
40
    /**
41
     *
42
     * @param SourceIterator $source
43
     * @param array $options
44
     * @return array
45
     */
46
    public function analyze(SourceIterator $source, array $options)
0 ignored issues
show
Unused Code introduced by
The parameter $options is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
47
    {
48
        $result = [];
49
        foreach ($source as $filename => $code) {
50
            $ast = $this->parser->parse($code);
51
52
            $issues = $this->getIssues($ast, [
53
                'filename' => $filename
54
            ]);
55
56
            $result[$filename] = new AnalyzedFile($filename, $issues);
57
        }
58
59
        return $result;
60
    }
61
62
    /**
63
     * @param $ast
64
     * @param array $data
65
     * @return Issue[]
66
     */
67
    protected function getIssues($ast, array $data)
0 ignored issues
show
Unused Code introduced by
The parameter $data is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
68
    {
69
        $exceptions = $this->flawDetector->analyze($ast);
70
        $issues = $this->messageProvider->translateExceptions($exceptions);
71
72
        return $issues;
73
    }
74
75
}
76