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.

Code Duplication    Length = 42-43 lines in 2 locations

src/CommandBus/Handler/Repository/AddLabelHandler.php 1 location

@@ 13-55 (lines=43) @@
10
use React\Promise\PromiseInterface;
11
use RingCentral\Psr7\Request;
12
13
final class AddLabelHandler
14
{
15
    /**
16
     * @var RequestService
17
     */
18
    private $requestService;
19
20
    /**
21
     * @var Hydrator
22
     */
23
    private $hydrator;
24
25
    /**
26
     * @param RequestService $requestService
27
     * @param Hydrator       $hydrator
28
     */
29
    public function __construct(RequestService $requestService, Hydrator $hydrator)
30
    {
31
        $this->requestService = $requestService;
32
        $this->hydrator = $hydrator;
33
    }
34
35
    /**
36
     * @param  AddLabelCommand  $command
37
     * @return PromiseInterface
38
     */
39
    public function handle(AddLabelCommand $command): PromiseInterface
40
    {
41
        return $this->requestService->request(
42
            new Request(
43
                'POST',
44
                'repos/' . $command->getRepository() . '/labels',
45
                [],
46
                new JsonStream([
47
                    'name' => $command->getName(),
48
                    'color' => $command->getColour(),
49
                ])
50
            )
51
        )->then(function ($label) {
52
            return $this->hydrator->hydrate(LabelInterface::HYDRATE_CLASS, $label->getBody()->getParsedContents());
53
        });
54
    }
55
}
56

src/CommandBus/Handler/Repository/RefHandler.php 1 location

@@ 13-54 (lines=42) @@
10
use React\Promise\PromiseInterface;
11
use RingCentral\Psr7\Request;
12
13
final class RefHandler
14
{
15
    /**
16
     * @var RequestService
17
     */
18
    private $requestService;
19
20
    /**
21
     * @var Hydrator
22
     */
23
    private $hydrator;
24
25
    /**
26
     * @param RequestService $requestService
27
     * @param Hydrator       $hydrator
28
     */
29
    public function __construct(RequestService $requestService, Hydrator $hydrator)
30
    {
31
        $this->requestService = $requestService;
32
        $this->hydrator = $hydrator;
33
    }
34
35
    /**
36
     * @param  RefCommand       $command
37
     * @return PromiseInterface
38
     */
39
    public function handle(RefCommand $command): PromiseInterface
40
    {
41
        return $this->requestService->request(
42
            new Request(
43
                'POST',
44
                'repos/' . $command->getRepository() . '/git/' . $command->getRef(),
45
                [],
46
                new JsonStream([
47
                    'sha' => $command->getCommit(),
48
                ])
49
            )
50
        )->then(function ($tree) {
51
            return $this->hydrator->hydrate(RefInterface::HYDRATE_CLASS, $tree->getBody()->getParsedContents());
52
        });
53
    }
54
}
55