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
04:26
created

CommandTasks::outputResults()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 2
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
    public function setOutput(OutputStyle $output) : self
20
    {
21
        $this->output = $output;
22
23
        return $this;
24
    }
25
26
    public function addTask($name, $result) : self
27
    {
28
        $this->results[$name] = $result;
29
30
        return $this;
31
    }
32
33
    public function outputResults() : void
34
    {
35
        collect($this->results)->each(function ($result, $description) {
36
            $this->output->writeLn(vsprintf('%s: %s', [
37
                $description,
38
                $result ? '<fg=green>✔</>' : '<fg=red>✘</>',
39
            ]));
40
        });
41
    }
42
43
    public function getResults() : array
44
    {
45
        return $this->results;
46
    }
47
}
48