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.

AuthorizationResponseFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 15
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 8 2
1
<?php
2
3
namespace JumpCloud\Factory;
4
5
use GuzzleHttp\Psr7\Response;
6
use JumpCloud\Response\AuthorizationResponse;
7
8
/**
9
 * Class AuthorizationResponseFactory
10
 * @package JumpCloud\Factory
11
 */
12
class AuthorizationResponseFactory implements ResponseFactoryInterface
13
{
14
    /**
15
     * @param Response $response
16
     * @return AuthorizationResponse
17
     */
18 12
    public function create(Response $response)
19
    {
20 12
        if ($response->getStatusCode() === 200) {
21 4
            return new AuthorizationResponse($response, AuthorizationResponse::AUTHORISED);
22
        }
23
24 8
        return new AuthorizationResponse($response, AuthorizationResponse::UNAUTHORISED);
25
    }
26
}
27