| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | private static function createStream($file = 'php://temp', $mode = 'r+') |
||
| 19 | { |
||
| 20 | $factory = Middleware::getStreamFactory(); |
||
| 21 | |||
| 22 | if ($factory === null) { |
||
| 23 | if (class_exists('Zend\\Diactoros\\Stream')) { |
||
| 24 | return new \Zend\Diactoros\Stream($file, $mode); |
||
| 25 | } |
||
| 26 | |||
| 27 | throw new \RuntimeException('Unable to create a stream. No stream factory defined'); |
||
| 28 | } |
||
| 29 | |||
| 30 | return call_user_func($factory, $file, $mode); |
||
| 31 | } |
||
| 32 | } |
||
| 33 |