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 ( 6ae441...2b5546 )
by Cees-Jan
15s queued 13s
created

StreamingRequestService::__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\Foundation\Transport\Service;
4
5
use ApiClients\Foundation\Transport\ClientInterface;
6
use ApiClients\Foundation\Transport\StreamingResponse;
7
use Psr\Http\Message\RequestInterface;
8
use Psr\Http\Message\ResponseInterface;
9
use React\Promise\CancellablePromiseInterface;
10
use function React\Promise\resolve;
11
12
class StreamingRequestService
13
{
14
    /**
15
     * @var ClientInterface
16
     */
17
    private $client;
18
19
    /**
20
     * @param ClientInterface $client
21
     */
22 1
    public function __construct(ClientInterface $client)
23
    {
24 1
        $this->client = $client;
25 1
    }
26
27
    /**
28
     * @param  RequestInterface            $request
29
     * @param  array                       $options
30
     * @return CancellablePromiseInterface
31
     */
32 1
    public function stream(RequestInterface $request, array $options = []): CancellablePromiseInterface
33
    {
34 1
        return $this->client->request(
35 1
            $request,
36 1
            $options
37 1
        )->then(function (ResponseInterface $response) {
38 1
            return resolve(new StreamingResponse($response));
39 1
        });
40
    }
41
}
42