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.
Completed
Push — master ( fb8f70...fcb615 )
by Cees-Jan
12:21 queued 02:24
created

JsonEncodeHandler::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Foundation\Transport\CommandBus\Handler;
4
5
use ApiClients\Foundation\Transport\CommandBus\Command\JsonEncodeCommand;
6
use React\EventLoop\LoopInterface;
7
use React\Promise\PromiseInterface;
8
use function WyriHaximus\React\futureFunctionPromise;
9
10
final class JsonEncodeHandler
11
{
12
    /**
13
     * @var LoopInterface
14
     */
15
    private $loop;
16
17
    /**
18
     * @param LoopInterface $loop
19
     */
20
    public function __construct(LoopInterface $loop)
21
    {
22
        $this->loop = $loop;
23
    }
24
25
    /**
26
     * @param JsonEncodeCommand $command
27
     * @return PromiseInterface
28
     */
29
    public function handle(JsonEncodeCommand $command): PromiseInterface
30
    {
31
        return futureFunctionPromise($this->loop, $command->getJson(), function ($json) {
32
            return json_encode($json);
33
        });
34
    }
35
}
36