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 ( 440f9f...c814ca )
by Freek
02:36
created

BaseHandler::canHandle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
3
namespace Spatie\SlashCommand\Handlers;
4
5
use Illuminate\Contracts\Bus\Dispatcher;
6
use Illuminate\Foundation\Bus\DispatchesJobs;
7
use Spatie\SlashCommand\HandlesSlashCommand;
8
use Spatie\SlashCommand\Jobs\ResponseJob;
9
use Spatie\SlashCommand\Request;
10
use Spatie\SlashCommand\Response;
11
12
abstract class BaseHandler implements HandlesSlashCommand
13
{
14
    use DispatchesJobs;
15
16
    /** @var \Spatie\SlashCommand\Request */
17
    protected $request;
18
19
    public function __construct(Request $request)
20
    {
21
        $this->request = $request;
22
    }
23
24
    public function respondToSlack(string $text): Response
25
    {
26
        return Response::create($this->request)->withText($text);
27
    }
28
29
    protected function dispatch(ResponseJob $job)
30
    {
31
        $job->setResponse($this->request);
32
33
        return app(Dispatcher::class)->dispatch($job);
34
    }
35
36
    public function getRequest(): Request
37
    {
38
        return $this->getRequest();
39
    }
40
41
    abstract public function handle(Request $request): Response;
42
}
43