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.

SlashCommandResponseJob   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getResponse() 0 4 1
A setRequest() 0 6 1
A respondToSlack() 0 4 1
A getRequest() 0 4 1
1
<?php
2
3
namespace Spatie\SlashCommand\Jobs;
4
5
use Illuminate\Contracts\Queue\ShouldQueue;
6
use Spatie\SlashCommand\HandlesSlashCommand;
7
use Spatie\SlashCommand\Request;
8
use Spatie\SlashCommand\Response;
9
10
abstract class SlashCommandResponseJob implements ShouldQueue, HandlesSlashCommand
11
{
12
    /** @var \Spatie\SlashCommand\Request */
13
    public $request;
14
15
    public function getResponse(): Response
16
    {
17
        return Response::create($this->request);
18
    }
19
20
    public function setRequest(Request $request)
21
    {
22
        $this->request = $request;
23
24
        return $this;
25
    }
26
27
    public function respondToSlack(string $text = ''): Response
28
    {
29
        return $this->getResponse()->withText($text);
30
    }
31
32
    public function getRequest(): Request
33
    {
34
        return $this->request;
35
    }
36
}
37