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:18
created

CommandTasks::getResults()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
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
     * Get the results of all tasks.
63
     *
64
     * @return array
65
     */
66
    public function getResults() : array
67
    {
68
        return $this->results;
69
    }
70
}
71