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
Pull Request — develop (#2)
by Gavin
02:42
created

AuthorizationResponseFactory::create()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
1
<?php declare(strict_types=1);
2
3
namespace JumpCloud\Response\Factory;
4
5
use Psr\Http\Message\ResponseInterface as HttpResponseInterface;
6
use JumpCloud\Response\ResponseInterface;
7
use JumpCloud\Response\AuthorizationResponse;
8
9
/**
10
 * Class AuthorizationResponseFactory
11
 * @package JumpCloud\Factory
12
 */
13
class AuthorizationResponseFactory implements ResponseFactoryInterface
14
{
15
    /**
16
     * @param HttpResponseInterface $response
17
     *
18
     * @return ResponseInterface
19
     */
20
    public function create(HttpResponseInterface $response): ResponseInterface
21
    {
22
        if ($response->getStatusCode() === 200) {
23
            return new AuthorizationResponse($response, AuthorizationResponse::AUTHORISED);
0 ignored issues
show
Compatibility introduced by
$response of type object<Psr\Http\Message\ResponseInterface> is not a sub-type of object<GuzzleHttp\Psr7\Response>. It seems like you assume a concrete implementation of the interface Psr\Http\Message\ResponseInterface to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
24
        }
25
26
        return new AuthorizationResponse($response, AuthorizationResponse::UNAUTHORISED);
0 ignored issues
show
Compatibility introduced by
$response of type object<Psr\Http\Message\ResponseInterface> is not a sub-type of object<GuzzleHttp\Psr7\Response>. It seems like you assume a concrete implementation of the interface Psr\Http\Message\ResponseInterface to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
27
    }
28
}
29