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

Error message hints at deprecated option checkGenericClassInNonGenericObjectType #11000

Closed
derrabus opened this issue May 13, 2024 · 6 comments
Closed

Comments

@derrabus
Copy link

Bug report

I'm using PHPStan 1.11.0 on a codebase that uses a generic class without specifying its template types:

class Foo
{
    private \SplObjectStorage $bar;
}

PHPStan rightfully complains about that, but lures me into using a deprecated option:

Property Foo::$bar with generic class SplObjectStorage does not specify its types: TObject, TData       
 💡 You can turn this off by setting checkGenericClassInNonGenericObjectType: false in your phpstan.neon.dist. 

Following that suggestion, I get:

 ⚠️  You're using a deprecated config option checkGenericClassInNonGenericObjectType ⚠️️

Code snippet that reproduces the problem

No response

Expected output

I think, the hint should be updated to reflect the new error identifier system.

Did PHPStan help you today? Did it make you happy in any way?

Great work with the new error identifier system. ❤️

Copy link

mergeable bot commented May 13, 2024

This bug report is missing a link to reproduction at phpstan.org/try.

It will most likely be closed after manual review.

@ondrejmirtes
Copy link
Member

I'll remove the tip altogether (I really don't want people to ignore this anymore 😅 ), what do you think?

@derrabus
Copy link
Author

@ondrejmirtes
Copy link
Member

But that's different... I'll probably add tips about how to solve different generics errors in the future.

@ondrejmirtes
Copy link
Member

Fixed phpstan/phpstan-src@d603c7b

@derrabus
Copy link
Author

Thanks!

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

2 participants