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 = 40-40 lines in 2 locations

src/CommandBus/Handler/RepositoryHandler.php 1 location

@@ 15-54 (lines=40) @@
12
use function React\Promise\resolve;
13
use function WyriHaximus\React\futureFunctionPromise;
14
15
final class RepositoryHandler
16
{
17
    /**
18
     * @var RequestService
19
     */
20
    private $requestService;
21
22
    /**
23
     * @var Hydrator
24
     */
25
    private $hydrator;
26
27
    /**
28
     * @param RequestService $requestService
29
     * @param Hydrator $hydrator
30
     */
31
    public function __construct(RequestService $requestService, Hydrator $hydrator)
32
    {
33
        $this->requestService = $requestService;
34
        $this->hydrator = $hydrator;
35
    }
36
37
    /**
38
     * Fetch the given repository and hydrate it
39
     *
40
     * @param RepositoryCommand $command
41
     * @return PromiseInterface
42
     */
43
    public function handle(RepositoryCommand $command): PromiseInterface
44
    {
45
        return $this->requestService->handle(
46
            new Request('GET', 'repos/' . $command->getRepository())
47
        )->then(function (ResponseInterface $response) {
48
            return resolve($this->hydrator->hydrate(
49
                RepositoryInterface::HYDRATE_CLASS,
50
                $response->getBody()->getJson()['repo']
51
            ));
52
        });
53
    }
54
}
55

src/CommandBus/Handler/UserHandler.php 1 location

@@ 15-54 (lines=40) @@
12
use function React\Promise\resolve;
13
use function WyriHaximus\React\futureFunctionPromise;
14
15
final class UserHandler
16
{
17
    /**
18
     * @var RequestService
19
     */
20
    private $requestService;
21
22
    /**
23
     * @var Hydrator
24
     */
25
    private $hydrator;
26
27
    /**
28
     * @param RequestService $requestService
29
     * @param Hydrator $hydrator
30
     */
31
    public function __construct(RequestService $requestService, Hydrator $hydrator)
32
    {
33
        $this->requestService = $requestService;
34
        $this->hydrator = $hydrator;
35
    }
36
37
    /**
38
     * Fetch the given repository and hydrate it
39
     *
40
     * @param UserCommand $command
41
     * @return PromiseInterface
42
     */
43
    public function handle(UserCommand $command): PromiseInterface
44
    {
45
        return $this->requestService->handle(
46
            new Request('GET', 'users')
47
        )->then(function (ResponseInterface $response) {
48
            return resolve($this->hydrator->hydrate(
49
                UserInterface::HYDRATE_CLASS,
50
                $response->getBody()->getJson()['user']
51
            ));
52
        });
53
    }
54
}
55