| Total Complexity | 9 |
| Total Lines | 77 |
| Duplicated Lines | 0 % |
| Coverage | 95.65% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 10 | final class PhpInputStream implements StreamInterface |
||
| 11 | { |
||
| 12 | use StreamTrait { |
||
| 13 | read as private readInternal; |
||
| 14 | getContents as private getContentsInternal; |
||
| 15 | } |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | private string $cache = ''; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var bool |
||
| 24 | */ |
||
| 25 | private bool $isEof = false; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param string|resource $stream |
||
| 29 | */ |
||
| 30 | 18 | public function __construct($stream = 'php://input') |
|
| 31 | { |
||
| 32 | 18 | $this->init($stream, 'r'); |
|
| 33 | 18 | } |
|
| 34 | |||
| 35 | /** |
||
| 36 | * {@inheritdoc} |
||
| 37 | */ |
||
| 38 | 1 | public function __toString(): string |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * {@inheritdoc} |
||
| 49 | */ |
||
| 50 | 2 | public function isWritable(): bool |
|
| 51 | { |
||
| 52 | 2 | return false; |
|
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * {@inheritdoc} |
||
| 57 | */ |
||
| 58 | 4 | public function read($length): string |
|
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * {@inheritdoc} |
||
| 75 | */ |
||
| 76 | 4 | public function getContents(): string |
|
| 87 | } |
||
| 88 | } |
||
| 89 |