| 1 | <?php |
||
| 11 | final class Streamer implements StreamerInterface |
||
| 12 | { |
||
| 13 | private $stream; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var array |
||
| 17 | */ |
||
| 18 | private $streams = []; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @Stream |
||
| 22 | * |
||
| 23 | * @param resource $stream |
||
| 24 | */ |
||
| 25 | 4 | public function __construct($stream) |
|
| 29 | |||
| 30 | /** |
||
| 31 | * @param resource[] $streams |
||
| 32 | */ |
||
| 33 | 4 | public function addStreams(array $streams) |
|
| 37 | |||
| 38 | /** |
||
| 39 | * Return single root stream |
||
| 40 | * |
||
| 41 | * @return resource |
||
| 42 | */ |
||
| 43 | 4 | public function getStream(string $string) |
|
| 64 | |||
| 65 | 4 | private function collect(array $match) : array |
|
| 74 | } |
||
| 75 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.