| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | public function createUploadedFile( |
||
| 13 | StreamInterface $stream, |
||
| 14 | int $size = null, |
||
| 15 | int $error = \UPLOAD_ERR_OK, |
||
| 16 | string $clientFilename = null, |
||
| 17 | string $clientMediaType = null |
||
| 18 | ): UploadedFileInterface { |
||
| 19 | if ($size === null) { |
||
| 20 | $size = $stream->getSize(); |
||
| 21 | if ($size === null) { |
||
| 22 | throw new \InvalidArgumentException('Stream size could not be determined.', 1566823423); |
||
| 23 | } |
||
| 24 | } |
||
| 25 | |||
| 26 | return new UploadedFile($stream, $size, $error, $clientFilename, $clientMediaType); |
||
| 27 | } |
||
| 29 |