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 ( bce9ad...5c78c2 )
by Joan
11:47
created

DiscordIdentityProviderException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 31
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A clientException() 0 7 2
A fromResponse() 0 4 1
1
<?php
2
/**
3
 * This file is part of the wohali/oauth2-discord-new library
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @copyright Copyright (c) Joan Touzet <[email protected]>
9
 * @license http://opensource.org/licenses/MIT MIT
10
 * @link https://packagist.org/packages/wohali/oauth2-discord-new Packagist
11
 * @link https://github.com/wohali/oauth2-discord-new GitHub
12
 */
13
14
namespace Wohali\OAuth2\Client\Provider\Exception;
15
16
use Psr\Http\Message\ResponseInterface;
17
18
class DiscordIdentityProviderException extends IdentityProviderException
19
{
20
    /**
21
     * Creates client exception from response
22
     *
23
     * @param  ResponseInterface $response
24
     * @param  array $data Parsed response data
25
     *
26
     * @return IdentityProviderException
27
     */
28 3
    public static function clientException(ResponseInterface $response, $data)
29
    {
30 3
        return static::fromResponse(
31 3
            $response,
32 3
            isset($data['message']) ? $data['message'] : json_encode($data)
33 1
        );
34
    }
35
36
    /**
37
     * Creates identity exception from response
38
     *
39
     * @param  ResponseInterface $response
40
     * @param  string $message
41
     *
42
     * @return IdentityProviderException
43
     */
44 3
    protected static function fromResponse(ResponseInterface $response, $message = null)
45
    {
46 3
        return new static($message, $response->getStatusCode(), (string) $response->getBody());
47
    }
48
}
49