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 ( a55f05...bfb702 )
by Cees-Jan
01:23 queued 24s
created

JsonDecodeService::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Tools\Json;
4
5
use ApiClients\Foundation\Service\ServiceInterface;
6
use React\EventLoop\LoopInterface;
7
use React\Promise\CancellablePromiseInterface;
8
use function ExceptionalJSON\decode;
9
use function WyriHaximus\React\futureFunctionPromise;
10
11
final class JsonDecodeService
12
{
13
    /**
14
     * @var LoopInterface
15
     */
16
    private $loop;
17
18
    /**
19
     * @param LoopInterface $loop
20
     */
21 4
    public function __construct(LoopInterface $loop)
22
    {
23 4
        $this->loop = $loop;
24 4
    }
25
26
    public function decode(string $input): CancellablePromiseInterface
27
    {
28 4
        return futureFunctionPromise($this->loop, $input, function ($json) {
29 4
            return decode($json, true);
30 4
        });
31
    }
32
}
33