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 — develop ( 853650...6daea0 )
by Gavin
06:42 queued 04:09
created

AuthorizationResponseFactory::create()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 8
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
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
    public function create(Response $response)
19
    {
20
        if ($response->getStatusCode() === 200) {
21
            return new AuthorizationResponse($response, AuthorizationResponse::AUTHORISED);
22
        }
23
24
        return new AuthorizationResponse($response, AuthorizationResponse::UNAUTHORISED);
25
    }
26
}
27