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   A

Complexity

Total Complexity 17

Size/Duplication

Total Lines 98
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 17
lcom 1
cbo 0
dl 0
loc 98
ccs 35
cts 35
cp 1
rs 10
c 0
b 0
f 0

17 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getJson() 0 4 1
A __toString() 0 4 1
A getContents() 0 4 1
A close() 0 3 1
A detach() 0 3 1
A getSize() 0 4 1
A isReadable() 0 4 1
A isWritable() 0 4 1
A isSeekable() 0 4 1
A rewind() 0 3 1
A seek() 0 4 1
A eof() 0 4 1
A tell() 0 4 1
A read() 0 4 1
A write() 0 4 1
A getMetadata() 0 4 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