| Conditions | 5 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 64 | private function isUploaded($file): bool |
||
| 65 | { |
||
| 66 | if (is_string($file)) { |
||
| 67 | //We can use native method |
||
| 68 | return is_uploaded_file($file); |
||
| 69 | } |
||
| 70 | |||
| 71 | if (is_array($file)) { |
||
| 72 | return isset($file['tmp_name']) && is_uploaded_file($file['tmp_name']); |
||
| 73 | } |
||
| 74 | |||
| 75 | if ($file instanceof UploadedFileInterface) { |
||
| 76 | return empty($file->getError()); |
||
| 77 | } |
||
| 78 | |||
| 79 | //Not uploaded |
||
| 80 | return false; |
||
| 81 | } |
||
| 82 | } |