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 = 30-30 lines in 4 locations

src/CommandBus/Handler/AnnotationsHandler.php 1 location

@@ 12-41 (lines=30) @@
9
use React\Promise\PromiseInterface;
10
use function React\Promise\resolve;
11
12
final class AnnotationsHandler
13
{
14
    /**
15
     * @var FetchAndHydrateService
16
     */
17
    private $service;
18
19
    /**
20
     * @param FetchAndIterateService $service
21
     */
22
    public function __construct(FetchAndIterateService $service)
23
    {
24
        $this->service = $service;
25
    }
26
27
    /**
28
     * Fetch the given repository and hydrate it.
29
     *
30
     * @param  AnnotationsCommand $command
31
     * @return PromiseInterface
32
     */
33
    public function handle(AnnotationsCommand $command): PromiseInterface
34
    {
35
        return resolve($this->service->iterate(
36
            'jobs/' . (string)$command->getRepositoryId() . '/annotations',
37
            'annotations',
38
            AnnotationInterface::HYDRATE_CLASS
39
        ));
40
    }
41
}
42

src/CommandBus/Handler/BranchesHandler.php 1 location

@@ 12-41 (lines=30) @@
9
use React\Promise\PromiseInterface;
10
use function React\Promise\resolve;
11
12
final class BranchesHandler
13
{
14
    /**
15
     * @var FetchAndHydrateService
16
     */
17
    private $service;
18
19
    /**
20
     * @param FetchAndIterateService $service
21
     */
22
    public function __construct(FetchAndIterateService $service)
23
    {
24
        $this->service = $service;
25
    }
26
27
    /**
28
     * Fetch the given repository and hydrate it.
29
     *
30
     * @param  BranchesCommand  $command
31
     * @return PromiseInterface
32
     */
33
    public function handle(BranchesCommand $command): PromiseInterface
34
    {
35
        return resolve($this->service->iterate(
36
            'repos/' . (string)$command->getRepositoryId() . '/branches',
37
            'branches',
38
            BranchInterface::HYDRATE_CLASS
39
        ));
40
    }
41
}
42

src/CommandBus/Handler/CachesHandler.php 1 location

@@ 12-41 (lines=30) @@
9
use React\Promise\PromiseInterface;
10
use function React\Promise\resolve;
11
12
final class CachesHandler
13
{
14
    /**
15
     * @var FetchAndHydrateService
16
     */
17
    private $service;
18
19
    /**
20
     * @param FetchAndIterateService $service
21
     */
22
    public function __construct(FetchAndIterateService $service)
23
    {
24
        $this->service = $service;
25
    }
26
27
    /**
28
     * Fetch the given repository and hydrate it.
29
     *
30
     * @param  CachesCommand    $command
31
     * @return PromiseInterface
32
     */
33
    public function handle(CachesCommand $command): PromiseInterface
34
    {
35
        return resolve($this->service->iterate(
36
            'repos/' . (string)$command->getRepositoryId() . '/caches',
37
            'caches',
38
            CacheInterface::HYDRATE_CLASS
39
        ));
40
    }
41
}
42

src/CommandBus/Handler/VarsHandler.php 1 location

@@ 12-41 (lines=30) @@
9
use React\Promise\PromiseInterface;
10
use function React\Promise\resolve;
11
12
final class VarsHandler
13
{
14
    /**
15
     * @var FetchAndHydrateService
16
     */
17
    private $service;
18
19
    /**
20
     * @param FetchAndIterateService $service
21
     */
22
    public function __construct(FetchAndIterateService $service)
23
    {
24
        $this->service = $service;
25
    }
26
27
    /**
28
     * Fetch the given repository and hydrate it.
29
     *
30
     * @param  VarsCommand      $command
31
     * @return PromiseInterface
32
     */
33
    public function handle(VarsCommand $command): PromiseInterface
34
    {
35
        return resolve($this->service->iterate(
36
            'settings/env_vars?repository_id=' . (string)$command->getRepositoryId(),
37
            'env_vars',
38
            EnvironmentVariableInterface::HYDRATE_CLASS
39
        ));
40
    }
41
}
42