Skip to content

Functions which return objects sometimes marked as returning resources #546

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

Closed
shish opened this issue Feb 4, 2025 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@shish
Copy link
Collaborator

shish commented Feb 4, 2025

eg imagecreate is marked as returning a resource when it actually returns a GdImage - #533 fixed this for function parameters, but didn't fix it for function return types

@shish shish added the bug Something isn't working label Feb 4, 2025
@shish shish mentioned this issue Feb 4, 2025
9 tasks
@dmecke
Copy link

dmecke commented Feb 4, 2025

Thank you for looking into this. The docblock of the image.php in the generated folders also state that it might return false - which is not true as the case is handled with an exception.
Sorry, if this was already obvious, I'm not too well aware where the project pulls its type information from.

shish added a commit that referenced this issue Feb 4, 2025
Unit tests should _generally_ have correct types - and I specifically want to add a test which covers a type-hinting problem, which will only be revealed by phpstan (#546)
shish added a commit that referenced this issue Feb 4, 2025
Unit tests should _generally_ have correct types - and I specifically want to add a test which covers a type-hinting problem, which will only be revealed by phpstan (#546)
@shish shish closed this as completed in fb6e84d Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants