Conditions | 8 |
Paths | 6 |
Total Lines | 24 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | private function resolveFilename($file) |
||
33 | { |
||
34 | if (empty($file)) { |
||
35 | return null; |
||
36 | } |
||
37 | |||
38 | if ( |
||
39 | ($file instanceof UploadedFileInterface && $file->getError() === 0) |
||
40 | || $file instanceof StreamableInterface |
||
41 | ) { |
||
42 | return StreamWrapper::localFilename($file->getStream()); |
||
43 | } |
||
44 | |||
45 | if (is_array($file)) { |
||
46 | //Temp filename. |
||
47 | $file = $file['tmp_name']; |
||
48 | } |
||
49 | |||
50 | if (!is_string($file) || !$this->files->exists($file)) { |
||
51 | return null; |
||
52 | } |
||
53 | |||
54 | return $file; |
||
55 | } |
||
56 | |||
82 | } |