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.

WebhookFailed::invalidSignature()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Multicoin\Api\Exceptions;
4
5
use Exception;
6
use Illuminate\Http\Request;
7
8
class WebhookFailed extends Exception
9
{
10
    public static function invalidSignature($signature)
11
    {
12
        return new static("The signature `{$signature}` found in the header named `X-Multicoin-Signature` is invalid.
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $signature instead of interpolation.

It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.

// Instead of
$x = "foo $bar $baz";

// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
13
            Make sure that the `multicoin.api_key` config key is set to the value you found on the multicoin account.");
14
    }
15
16
    public static function missingSignature()
17
    {
18
        return new static('The request did not contain a header named `X-Multicoin-Signature`.');
19
    }
20
21
    public static function missingType(Request $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

21
    public static function missingType(/** @scrutinizer ignore-unused */ Request $request)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
22
    {
23
        return new static('The webhook call did not contain a type. Valid calls should always contain a type.');
24
    }
25
26
    public function render($request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

26
    public function render(/** @scrutinizer ignore-unused */ $request)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
27
    {
28
        return response(['error' => $this->getMessage()], 400);
29
    }
30
31
    public static function signingSecretNotSet()
32
    {
33
        return new static('The webhook signing secret is not set.
34
            Make sure that the `multicoin.api_key` config key is set.');
35
    }
36
}
37