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.

couldNotCommunicateWithMsTeams()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace NotificationChannels\MsTeams\Exceptions;
4
5
use GuzzleHttp\Exception\ClientException;
6
7
class CouldNotSendNotification extends \Exception
8
{
9
    /**
10
     * Thrown when there's a bad request and an error is responded.
11
     *
12
     * @param ClientException $exception
13
     *
14
     * @return static
15
     */
16
    public static function msTeamsRespondedWithAnError(ClientException $exception)
17
    {
18
        $statusCode = $exception->getResponse()->getStatusCode();
19
        $description = $exception->getMessage();
20
21
        return new static("Ms Teams responded with an error `{$statusCode} - {$description}`");
22
    }
23
24
    /**
25
     * Thrown when we're unable to communicate with Ms Teams.
26
     *
27
     * @return static
28
     */
29
    public static function couldNotCommunicateWithMsTeams($message)
30
    {
31
        return new static("The communication with Ms Teams failed. `{$message}`");
32
    }
33
34
    /**
35
     * Thrown when there is no chat id provided.
36
     *
37
     * @return static
38
     */
39 1
    public static function connectorWebHookUrlMissing()
40
    {
41 1
        return new static('Ms Teams a webhook url is missing.');
42
    }
43
}
44