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
01:47
created

CommandTasks   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 2
dl 0
loc 41
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
    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