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 2 locations

src/CommandBus/Handler/AstronomyHandler.php 1 location

@@ 11-40 (lines=30) @@
8
use ApiClients\Tools\Services\Client\FetchAndHydrateService;
9
use React\Promise\PromiseInterface;
10
11
final class AstronomyHandler
12
{
13
    /**
14
     * @var FetchAndHydrateService
15
     */
16
    private $service;
17
18
    /**
19
     * @param FetchAndHydrateService $service
20
     */
21
    public function __construct(FetchAndHydrateService $service)
22
    {
23
        $this->service = $service;
24
    }
25
26
    /**
27
     * Fetch the given repository and hydrate it
28
     *
29
     * @param AstronomyCommand $command
30
     * @return PromiseInterface
31
     */
32
    public function handle(AstronomyCommand $command): PromiseInterface
33
    {
34
        return $this->service->fetch(
35
            'astronomy/q/' . $command->getLocation() . '.json',
36
            '',
37
            AstronomyInterface::HYDRATE_CLASS
38
        );
39
    }
40
}
41

src/CommandBus/Handler/ConditionsHandler.php 1 location

@@ 12-41 (lines=30) @@
9
use function React\Promise\resolve;
10
use function WyriHaximus\React\futureFunctionPromise;
11
12
final class ConditionsHandler
13
{
14
    /**
15
     * @var FetchAndHydrateService
16
     */
17
    private $service;
18
19
    /**
20
     * @param FetchAndHydrateService $service
21
     */
22
    public function __construct(FetchAndHydrateService $service)
23
    {
24
        $this->service = $service;
25
    }
26
27
    /**
28
     * Fetch the given repository and hydrate it
29
     *
30
     * @param ConditionsCommand $command
31
     * @return PromiseInterface
32
     */
33
    public function handle(ConditionsCommand $command): PromiseInterface
34
    {
35
        return $this->service->fetch(
36
            'conditions/q/' . $command->getLocation() . '.json',
37
            'current_observation',
38
            ConditionInterface::HYDRATE_CLASS
39
        );
40
    }
41
}
42