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.

ConsolePlainFeedback::generate()   B
last analyzed

Complexity

Conditions 4
Paths 3

Size

Total Lines 27
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 17
nc 3
nop 2
dl 0
loc 27
rs 8.5806
c 0
b 0
f 0
1
<?php
2
3
namespace Inspector\Analysis\Feedback;
4
5
use PhpParser\Node;
6
use Inspector\Analysis\Result\AnalysisResult;
7
use Symfony\Component\Console\Output\OutputInterface;
8
9
/**
10
 * @author Kabir Baidhya
11
 */
12
class ConsolePlainFeedback implements FeedbackInterface
13
{
14
15
    /**
16
     * @var array
17
     */
18
    protected $config;
19
20
    /**
21
     * @var OutputInterface
22
     */
23
    protected $output;
24
25
    /**
26
     * @param array $config
27
     * @param OutputInterface $output
28
     */
29
    public function __construct(array $config, OutputInterface $output)
30
    {
31
        $this->config = $config;
32
        $this->output = $output;
33
    }
34
35
    /**
36
     * Generates the feedback.
37
     *
38
     * @param AnalysisResult $result
39
     * @param array $params
40
     * @return string
0 ignored issues
show
Documentation introduced by
Should the return type not be string|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
41
     */
42
    public function generate(AnalysisResult $result, array $params)
43
    {
44
        $this->output->writeln(
45
            "\n" . sprintf('<info>Code Rating:</info> %s', $result->getRatingDescription())
46
        );
47
48
        $fileIndex = 1;
49
        foreach ($result->getFiles() as $filename => $file) {
50
51
            $relativePath = $file->getRelativeFilename($params['basePath']);
52
            $this->output->writeln(
53
                sprintf(
54
                    "\n<comment>File #%d.</comment> %s <question> %s </question>", $fileIndex, $relativePath,
55
                    $file->getQualityRating()
56
                ) . ($file->isOkay() ? ' - OK' : '')
57
            );
58
            $index = 1;
59
            foreach ($file->getIssues() as $issue) {
60
61
                $this->output->writeln(
62
                    sprintf(' Issue %d: %s', $index, strip_tags($issue->getMessage()))
63
                );
64
                $index++;
65
            }
66
            $fileIndex++;
67
        }
68
    }
69
70
}
71