Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading docblock of the file_get_info function #6251

Open
4levels opened this issue Nov 28, 2023 · 0 comments
Open

Misleading docblock of the file_get_info function #6251

4levels opened this issue Nov 28, 2023 · 0 comments

Comments

@4levels
Copy link

4levels commented Nov 28, 2023

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:

  • 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

Please find the function doblock return type below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant