the function file_get_info() has a docblock stating that it always returns an array, but it clearly does not as the first if statement will return FALSE instead of an array. This can easily lead to bugs as the code using the file_get_info() can easily assume this coming from the docblock comment.
The fix would be:
either update the docblock to mention that the function can also return a boolean false @return array => @return array|false
change the return to an empty array instead of boolean false
Hi,
the function
file_get_info()
has a docblock stating that it always returns an array, but it clearly does not as the first if statement will return FALSE instead of an array. This can easily lead to bugs as the code using the file_get_info() can easily assume this coming from the docblock comment.The fix would be:
@return array
=>@return array|false
Please find the function doblock return type below. https://github.com/bcit-ci/CodeIgniter/blob/63d037565dd782795021dcbd3b1ca6f8c8a509e4/system/helpers/file_helper.php#L259