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.
Passed
Push — master ( 82890f...764f4d )
by
unknown
17:48 queued 05:10
created

HoneybadgerCheckInCommand::checkInIdOrName()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Honeybadger\HoneybadgerLaravel\Commands;
4
5
use Exception;
6
use Honeybadger\Contracts\Reporter;
7
use Illuminate\Console\Command;
8
9
class HoneybadgerCheckInCommand extends Command
10
{
11
    /**
12
     * The name and signature of the console command.
13
     * "id" can be the check-in ID or the check-in slug.
14
     *
15
     * @var string
16
     */
17
    protected $signature = 'honeybadger:checkin {id}';
18
19
    /**
20
     * The console command description.
21
     *
22
     * @var string
23
     */
24
    protected $description = 'Send check-in to Honeybadger';
25
26
    /**
27
     * Execute the console command.
28
     *
29
     * @return mixed
30
     */
31
    public function handle(Reporter $honeybadger)
32
    {
33
        try {
34
            $idOrSlug = $this->checkInIdOrSlug();
35
            $honeybadger->checkin($idOrSlug);
36
            $this->info(sprintf('Check-in %s was sent to Honeybadger', $idOrSlug));
37
        } catch (Exception $e) {
38
            $this->error($e->getMessage());
39
        }
40
    }
41
42
    private function checkInIdOrSlug(): string
43
    {
44
        return is_array($this->argument('id'))
45
            ? $this->argument('id')[0]
46
            : $this->argument('id');
47
    }
48
}
49