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
Push — master ( e97bb7...5f2eb5 )
by Pascal
10:40 queued 09:38
created

RunCheckers   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 33 4
1
<?php
2
3
namespace ProtoneMedia\ApiHealth\Console;
4
5
use Illuminate\Console\Command;
6
use ProtoneMedia\ApiHealth\Checkers\Executor;
7
use ProtoneMedia\ApiHealth\Runner;
8
9
class RunCheckers extends Command
10
{
11
    /**
12
     * The name and signature of the console command.
13
     *
14
     * @var string
15
     */
16
    protected $signature = 'api-health:run-checkers {--force}';
17
18
    /**
19
     * The console command description.
20
     *
21
     * @var string
22
     */
23
    protected $description = 'Run the configured checkers';
24
25
    /**
26
     * Gets the passing and failing checkers from the Runner
27
     * and presents them in a table.
28
     *
29
     * @return null
30
     */
31
    public function handle()
32
    {
33
        $runner = Runner::fromConfig();
34
35
        if ($this->option('force')) {
36
            $runner->ignoreScheduling();
37
        }
38
39
        $failed = $runner->failed();
40
41
        $passes = $runner->passes();
42
43
        $this->info('Total checkers run: ' . ($failed->count() + $passes->count()));
44
45
        if ($passes->isNotEmpty()) {
46
            $this->line('');
47
            $this->info('Passing checkers:');
48
            $this->table(['Checker'], $passes->map(function (Executor $executor) {
49
                return [get_class($executor->getChecker())];
50
            }));
51
        }
52
53
        if ($failed->isNotEmpty()) {
54
            $this->line('');
55
            $this->error('Failed checkers:');
56
            $this->table(['Checker', 'Exception'], $failed->map(function (Executor $executor) {
57
                return [
58
                    get_class($executor->getChecker()),
59
                    $executor->getException()->getMessage(),
60
                ];
61
            }));
62
        }
63
    }
64
}
65