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 ( 09657c...b003c5 )
by Pascal
07:43
created

Check::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.7998
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Pbmedia\ApiHealth\Console;
4
5
use Illuminate\Console\Command;
6
use Pbmedia\ApiHealth\Checkers\Executor;
7
8
class Check extends Command
9
{
10
    /**
11
     * The name and signature of the console command.
12
     *
13
     * @var string
14
     */
15
    protected $signature = 'api-health:check {checkerClass}';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Run the given checker';
23
24
    /**
25
     * Displays the result of the given checker.
26
     *
27
     * @return null
28
     */
29
    public function handle()
30
    {
31
        $executor = Executor::make(
32
            $checkerClass = $this->argument('checkerClass')
0 ignored issues
show
Bug introduced by
It seems like $checkerClass = $this->argument('checkerClass') can also be of type array; however, Pbmedia\ApiHealth\Checkers\Executor::make() does only seem to accept string, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
33
        );
34
35
        $this->info('Running checker: ' . $checkerClass);
36
37
        if ($executor->passes()) {
38
            $this->info('Passes!');
39
        } else {
40
            $this->error('Fails! ' . $executor->getException()->getMessage());
41
        }
42
    }
43
}
44