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 ( 97ac62...e852ca )
by Cees-Jan
11:49 queued 08:28
created

JsonStream::detach()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 1
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Middleware\Json;
4
5
use Psr\Http\Message\StreamInterface;
6
use RuntimeException;
7
8
class JsonStream implements StreamInterface
9
{
10
    /**
11
     * @var array
12
     */
13
    private $json = [];
14
15 7
    public function __construct(array $json)
16
    {
17 7
        $this->json = $json;
18 7
    }
19
20
    /**
21
     * @return array
22
     */
23 3
    public function getJson()
24
    {
25 3
        return $this->json;
26
    }
27
28 1
    public function __toString()
29
    {
30 1
        return $this->getContents();
31
    }
32
33 1
    public function getContents()
34
    {
35 1
        return '';
36
    }
37
38 1
    public function close()
39
    {
40 1
    }
41
42 1
    public function detach()
43
    {
44 1
    }
45
46 1
    public function getSize()
47
    {
48 1
        return count($this->json);
49
    }
50
51 1
    public function isReadable()
52
    {
53 1
        return true;
54
    }
55
56 1
    public function isWritable()
57
    {
58 1
        return false;
59
    }
60
61 1
    public function isSeekable()
62
    {
63 1
        return false;
64
    }
65
66 1
    public function rewind()
67
    {
68 1
    }
69
70 1
    public function seek($offset, $whence = SEEK_SET)
71
    {
72 1
        throw new RuntimeException('Cannot seek a BufferStream');
73
    }
74
75 1
    public function eof()
76
    {
77 1
        return true;
78
    }
79
80 1
    public function tell()
81
    {
82 1
        throw new RuntimeException('Cannot determine the position of a BufferStream');
83
    }
84
85
    /**
86
     * Reads data from the buffer.
87
     */
88 1
    public function read($length)
89
    {
90 1
        throw new RuntimeException('Cannot read from a JsonStream');
91
    }
92
93
    /**
94
     * Writes data to the buffer.
95
     */
96 1
    public function write($string)
97
    {
98 1
        throw new RuntimeException('Cannot write to a JsonStream');
99
    }
100
101 1
    public function getMetadata($key = null)
102
    {
103 1
        return [];
104
    }
105
}
106