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 ( 92bedd...82890f )
by
unknown
13:30 queued 01:04
created

HoneybadgerCheckInCommand   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 12
dl 0
loc 43
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A checkInIdOrName() 0 5 2
A handle() 0 8 2
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 name.
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
            $idOrName = $this->checkInIdOrName();
35
            $honeybadger->checkin($idOrName);
36
            $this->info(sprintf('Check-in %s was sent to Honeybadger', $idOrName));
37
        } catch (Exception $e) {
38
            $this->error($e->getMessage());
39
        }
40
    }
41
42
    /**
43
     * Get the API key from input.
44
     *
45
     * @return string
46
     */
47
    private function checkInIdOrName(): string
48
    {
49
        return is_array($this->argument('id'))
50
            ? $this->argument('id')[0]
51
            : $this->argument('id');
52
    }
53
}
54