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/ProgramHandler.php 1 location

@@ 15-57 (lines=43) @@
12
use React\Promise\PromiseInterface;
13
use function React\Promise\resolve;
14
15
final class ProgramHandler
16
{
17
    /**
18
     * @var XmlRpcService
19
     */
20
    private $service;
21
22
    /**
23
     * @var Hydrator
24
     */
25
    private $hydrator;
26
27
    /**
28
     * @param XmlRpcService $service
29
     * @param Hydrator      $hydrator
30
     */
31
    public function __construct(XmlRpcService $service, Hydrator $hydrator)
32
    {
33
        $this->service = $service;
34
        $this->hydrator = $hydrator;
35
    }
36
37
    /**
38
     * @param  ProgramsCommand  $command
39
     * @return PromiseInterface
40
     */
41
    public function handle(ProgramCommand $command): PromiseInterface
42
    {
43
        return $this->service->call(
44
            'supervisor.getProcessInfo',
45
            [
46
                $command->getName(),
47
            ]
48
        )->then(function (array $program) {
49
            return resolve(
50
                $this->hydrator->hydrate(
51
                    ProgramInterface::HYDRATE_CLASS,
52
                    $program
53
                )
54
            );
55
        });
56
    }
57
}
58

src/CommandBus/Handler/ProgramsHandler.php 1 location

@@ 15-56 (lines=42) @@
12
use function ApiClients\Tools\Rx\observableFromArray;
13
use function React\Promise\resolve;
14
15
final class ProgramsHandler
16
{
17
    /**
18
     * @var XmlRpcService
19
     */
20
    private $service;
21
22
    /**
23
     * @var Hydrator
24
     */
25
    private $hydrator;
26
27
    /**
28
     * @param XmlRpcService $service
29
     * @param Hydrator      $hydrator
30
     */
31
    public function __construct(XmlRpcService $service, Hydrator $hydrator)
32
    {
33
        $this->service = $service;
34
        $this->hydrator = $hydrator;
35
    }
36
37
    /**
38
     * @param  ProgramsCommand  $command
39
     * @return PromiseInterface
40
     */
41
    public function handle(ProgramsCommand $command): PromiseInterface
42
    {
43
        return $this->service->call('supervisor.getAllProcessInfo')->then(function (array $xml) {
44
            return resolve(
45
                observableFromArray(
46
                    $xml
47
                )->map(function ($program) {
48
                    return $this->hydrator->hydrate(
49
                        ProgramInterface::HYDRATE_CLASS,
50
                        $program
51
                    );
52
                })
53
            );
54
        });
55
    }
56
}
57