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.

Issues (1)

src/Exceptions/CouldNotSendNotification.php (1 issue)

Severity
1
<?php
2
3
namespace NotificationChannels\Discord\Exceptions;
4
5
use Exception;
6
use Illuminate\Support\Arr;
7
use Psr\Http\Message\ResponseInterface;
8
9
class CouldNotSendNotification extends Exception
10
{
11
    /**
12
     * @param \Psr\Http\Message\ResponseInterface $response
13
     * @param int $code
14
     * @param \Exception $exception
15
     *
16
     * @return static
17
     */
18 1
    public static function serviceRespondedWithAnHttpError(ResponseInterface $response, $code, $exception)
19
    {
20 1
        $message = "Discord responded with an HTTP error: {$response->getStatusCode()}";
21
22 1
        if ($error = Arr::get(json_decode($response->getBody(), true), 'message')) {
23 1
            $message .= ": $error";
24
        }
25
26 1
        return new static($message, $code, $exception);
27
    }
28
29
    /**
30
     * @param array $response
31
     * @param int $code
32
     *
33
     * @return static
34
     */
35 1
    public static function serviceRespondedWithAnApiError(array $response, $code, $exception = null)
0 ignored issues
show
The parameter $exception 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

35
    public static function serviceRespondedWithAnApiError(array $response, $code, /** @scrutinizer ignore-unused */ $exception = null)

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...
36
    {
37 1
        return new static("Discord responded with an API error: {$response['code']}: {$response['message']}", $code);
38
    }
39
40
    /**
41
     * @param \Exception $exception
42
     *
43
     * @return static
44
     */
45 2
    public static function serviceCommunicationError(Exception $exception)
46
    {
47 2
        return new static("Communication with Discord failed: {$exception->getCode()}: {$exception->getMessage()}", $exception->getCode(), $exception);
48
    }
49
}
50