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

src/CommandBus/Handler/RepositoriesHandler.php 1 location

@@ 15-53 (lines=39) @@
12
use function React\Promise\resolve;
13
use function WyriHaximus\React\futureFunctionPromise;
14
15
final class RepositoriesHandler
16
{
17
    /**
18
     * @var IteratePagesService
19
     */
20
    private $iteratePagesService;
21
22
    /**
23
     * @var Hydrator
24
     */
25
    private $hydrator;
26
27
    /**
28
     * @param IteratePagesService $iteratePagesService
29
     * @param Hydrator $hydrator
30
     */
31
    public function __construct(IteratePagesService $iteratePagesService, Hydrator $hydrator)
32
    {
33
        $this->iteratePagesService = $iteratePagesService;
34
        $this->hydrator = $hydrator;
35
    }
36
37
    /**
38
     * Fetch the given repository and hydrate it
39
     *
40
     * @param RepositoriesCommand $command
41
     * @return PromiseInterface
42
     */
43
    public function handle(RepositoriesCommand $command): PromiseInterface
44
    {
45
        return resolve(unwrapObservableFromPromise(
46
            $this->iteratePagesService->handle('users/' . $command->getLogin() . '/repos')
47
        )->flatMap(function ($repositories) {
48
            return Observable::fromArray($repositories);
49
        })->map(function ($repository) {
50
            return $this->hydrator->hydrate(RepositoryInterface::HYDRATE_CLASS, $repository);
51
        }));
52
    }
53
}
54

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

@@ 15-51 (lines=37) @@
12
use function React\Promise\resolve;
13
use function WyriHaximus\React\futureFunctionPromise;
14
15
final class LabelsHandler
16
{
17
    /**
18
     * @var IteratePagesService
19
     */
20
    private $iteratePagesService;
21
22
    /**
23
     * @var Hydrator
24
     */
25
    private $hydrator;
26
27
    /**
28
     * @param IteratePagesService $iteratePagesService
29
     * @param Hydrator $hydrator
30
     */
31
    public function __construct(IteratePagesService $iteratePagesService, Hydrator $hydrator)
32
    {
33
        $this->iteratePagesService = $iteratePagesService;
34
        $this->hydrator = $hydrator;
35
    }
36
37
    /**
38
     * @param LabelsCommand $command
39
     * @return PromiseInterface
40
     */
41
    public function handle(LabelsCommand $command): PromiseInterface
42
    {
43
        return resolve(unwrapObservableFromPromise(
44
            $this->iteratePagesService->handle('repos/' . $command->getFullName() . '/labels')
45
        )->flatMap(function ($labels) {
46
            return Observable::fromArray($labels);
47
        })->map(function ($label) {
48
            return $this->hydrator->hydrate(LabelInterface::HYDRATE_CLASS, $label);
49
        }));
50
    }
51
}
52