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.

StreamingResponse   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 40
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getResponse() 0 4 1
A _subscribe() 0 10 1
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Foundation\Transport;
4
5
use Psr\Http\Message\ResponseInterface;
6
use Rx\Disposable\EmptyDisposable;
7
use Rx\DisposableInterface;
8
use Rx\Observable;
9
use Rx\ObserverInterface;
10
11
final class StreamingResponse extends Observable
12
{
13
    /**
14
     * @var ResponseInterface
15
     */
16
    private $response;
17
18
    /**
19
     * @param ResponseInterface $response
20
     */
21 3
    public function __construct(ResponseInterface $response)
22
    {
23 3
        $this->response = $response;
24 3
    }
25
26
    /**
27
     * @return ResponseInterface
28
     */
29 2
    public function getResponse(): ResponseInterface
30
    {
31 2
        return $this->response;
32
    }
33
34
    /**
35
     * @param  ObserverInterface   $observer
36
     * @return DisposableInterface
37
     * @ignoreCodeCoverage
38
     */
39
    // @codingStandardsIgnoreStart
40 2
    protected function _subscribe(ObserverInterface $observer): DisposableInterface
41
    {
42
        // @codingStandardsIgnoreEnd
43 2
        $body = $this->response->getBody();
44 2
        $body->on('data', [$observer, 'onNext']);
45 2
        $body->on('error', [$observer, 'onError']);
46 2
        $body->on('end', [$observer, 'onCompleted']);
47
48 2
        return new EmptyDisposable();
49
    }
50
}
51