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