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 ( 4ae790...236d40 )
by TJ
02:47
created

HoneybadgerCheckinCommand::handle()   A

Complexity

Conditions 2
Paths 3

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 3
nop 1
1
<?php
2
3
namespace Honeybadger\HoneybadgerLaravel\Commands;
4
5
use Exception;
6
use Illuminate\Console\Command;
7
use Honeybadger\Contracts\Reporter;
8
9
class HoneybadgerCheckinCommand extends Command
10
{
11
    /**
12
     * The name and signature of the console command.
13
     *
14
     * @var string
15
     */
16
    protected $signature = 'honeybadger:checkin {id}';
17
18
    /**
19
     * The console command description.
20
     *
21
     * @var string
22
     */
23
    protected $description = 'Send check-in to Honeybadger';
24
25
    /**
26
     * Execute the console command.
27
     *
28
     * @return mixed
29
     */
30
    public function handle(Reporter $honeybadger)
31
    {
32
        try {
33
            $honeybadger->checkin($this->apiKey());
34
            $this->info(sprintf('Checkin %s was sent to Honeybadger', $this->argument('id')));
35
        } catch (Exception $e) {
36
            $this->error($e->getMessage());
37
        }
38
    }
39
40
    /**
41
     * Get the API key from input.
42
     *
43
     * @return string
44
     */
45
    private function apiKey() : string
46
    {
47
        return is_array($this->argument('id'))
48
            ? $this->argument('id')[0]
49
            : $this->argument('id');
50
    }
51
}
52