bcit-ci / CodeIgniter

Open Source PHP Framework (originally from EllisLab)
https://codeigniter.com/
MIT License
18.27k stars 7.6k forks source link

Misleading docblock of the file_get_info function #6251

Open 4levels opened 12 months ago

4levels commented 12 months ago

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:

Please find the function doblock return type below. https://github.com/bcit-ci/CodeIgniter/blob/63d037565dd782795021dcbd3b1ca6f8c8a509e4/system/helpers/file_helper.php#L259