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.
Completed
Pull Request — master (#11)
by TJ
02:09
created

CommandTasks   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 2
dl 0
loc 65
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setOutput() 0 6 1
A addTask() 0 6 1
A outputResults() 0 9 2
A getResults() 0 4 1
1
<?php
2
3
namespace Honeybadger\HoneybadgerLaravel;
4
5
use Illuminate\Console\OutputStyle;
6
7
class CommandTasks
8
{
9
    /**
10
     * @var \Illuminate\Console\OutputStyle
11
     */
12
    protected $output;
13
14
    /**
15
     * @var array
16
     */
17
    protected $results = [];
18
19
    /**
20
     * Set command output.
21
     *
22
     * @param  /Illuminate\Console\OutputStyle  $output
0 ignored issues
show
Documentation introduced by
The doc-type /Illuminate\Console\OutputStyle could not be parsed: Unknown type name "/Illuminate\Console\OutputStyle" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
23
     * @return self
24
     */
25
    public function setOutput(OutputStyle $output) : self
26
    {
27
        $this->output = $output;
28
29
        return $this;
30
    }
31
32
    /**
33
     * Add task with result to the stack.
34
     *
35
     * @param  string  $name
36
     * @param  bool  $result
37
     * @return self
38
     */
39
    public function addTask(string $name, bool $result) : self
40
    {
41
        $this->results[$name] = $result;
42
43
        return $this;
44
    }
45
46
    /**
47
     * Send results to the command output
48
     *
49
     * @return void
50
     */
51
    public function outputResults() : void
52
    {
53
        collect($this->results)->each(function ($result, $description) {
54
            $this->output->writeLn(vsprintf('%s: %s', [
55
                $description,
56
                $result ? '<fg=green>✔</>' : '<fg=red>✘</>',
57
            ]));
58
        });
59
    }
60
61
62
    /**
63
     * Get the results of all tasks.
64
     *
65
     * @return array
66
     */
67
    public function getResults() : array
68
    {
69
        return $this->results;
70
    }
71
}
72