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.

Authorization::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 9

Duplication

Lines 16
Ratio 100 %

Code Coverage

Tests 10
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 16
loc 16
ccs 10
cts 10
cp 1
rs 9.4285
cc 1
eloc 9
nc 1
nop 3
crap 1
1
<?php
2
3
namespace JumpCloud\Operation;
4
5
use JumpCloud\Request\AuthorizationRequestInterface;
6
use JumpCloud\Factory\AuthorizationResponseFactory;
7
use JumpCloud\Request\Request;
8
use JumpCloud\Request\RequestInterface;
9
10
/**
11
 * Class Authorization
12
 * @package JumpCloud\Operation
13
 */
14 View Code Duplication
class Authorization implements RequestInterface, AuthorizationRequestInterface
1 ignored issue
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
{
16
    use RequestOperationTrait;
17
18
    /**
19
     * Authorization constructor.
20
     * @param $username
21
     * @param $password
22
     * @param $tag
23
     */
24 6
    public function __construct($username, $password, $tag)
25
    {
26 6
        $request = new Request();
27 6
        $request->setBody(
28
            [
29 6
                'username' => $username,
30 6
                'password' => $password,
31 6
                'tag' => $tag
32
            ]
33
        );
34
35 6
        $request->setUri(AuthorizationRequestInterface::ENDPOINT);
36 6
        $request->setResponseFactory(new AuthorizationResponseFactory());
37
38 6
        $this->request = $request;
39 6
    }
40
}
41