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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 9 2
A apiKey() 0 6 2
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