| Total Complexity | 6 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | class StringReader |
||
| 20 | { |
||
| 21 | private ?string $base; |
||
| 22 | |||
| 23 | private ?string $uri; |
||
| 24 | |||
| 25 | private array $stream = []; |
||
| 26 | |||
| 27 | 2 | public function getBase(): ?string |
|
| 30 | } |
||
| 31 | |||
| 32 | 2 | public function init($path, $data) |
|
| 33 | { |
||
| 34 | 2 | $this->base = calcBase($path); |
|
| 35 | 2 | $this->uri = calcURI($path, $this->base); |
|
| 36 | |||
| 37 | 2 | $this->stream = [ |
|
| 38 | 2 | 'type' => 'data', |
|
| 39 | 2 | 'pos' => 0, |
|
| 40 | 2 | 'headers' => [], |
|
| 41 | 2 | 'size' => \strlen($data), |
|
| 42 | 2 | 'data' => $data, |
|
| 43 | 2 | 'buffer' => '', |
|
| 44 | 2 | ]; |
|
| 45 | } |
||
| 46 | |||
| 47 | 2 | public function readStream(int $d_size = 1024): string |
|
| 70 | } |
||
| 71 | } |
||
| 72 |