Conditions | 4 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public static function isValidUploadFile(array $arrMimeType = array(), UploadedFile $uploadedFile) : bool |
||
21 | { |
||
22 | //check if is valid file |
||
23 | if ($uploadedFile===null || empty($uploadedFile) || !$uploadedFile->isValid()) { |
||
24 | return false; |
||
25 | } |
||
26 | |||
27 | // Check if uploaded File has a correct MimeType if specified. |
||
28 | return UplodedFileHelper::hasValidMimeType($arrMimeType, $uploadedFile); |
||
29 | } |
||
30 | |||
55 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.