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 ( b62982...d1158c )
by Freek
02:01
created

guardAgainstInvalidSlashCommandRequest()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 5
nc 3
nop 1
1
<?php
2
3
namespace Spatie\SlashCommand;
4
5
use Illuminate\Http\Request;
6
7
class SlashCommandRequest
8
{
9
    /** Illuminate\Http\Request */
10
    public $request;
11
12
    public static function createForRequest(Request $request)
13
    {
14
        self::guardAgainstInvalidSlashCommandRequest($request);
15
16
        return new static($request);
17
    }
18
19
    protected static function guardAgainstInvalidSlashCommandRequest($request)
20
    {
21
        if (!$request->has('token')) {
22
            throw InvalidSlashCommandRequest::tokenNotFound();
23
        }
24
25
        if ($request->get('token') != config('laravel-slack.verification_token')) {
26
            throw InvalidSlashCommandRequest::invalidToken($request->get('token'));
27
        }
28
    }
29
30
    protected function __construct($request)
31
    {
32
        $this->request = $request;
33
    }
34
}
35