-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
PHPStan level 6 #487
PHPStan level 6 #487
Conversation
To reach level 6 of PHPStan
* @return AuditReader | ||
* @return AuditReader<object> | ||
*/ | ||
public function createAuditReader(EntityManager $em) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this means that when calling AuditManager::createAuditReader()
would be always of type object
and calling then for example AuditReader::find(Foo::class)
would always return an object of type object
instead of a Foo
object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#488 (comment) might be a good way to solve this and still keep the generic
I've created #488 since raising PHPStan level after this to level 7 shows 131 errors (vs. 23 in #488), example of errors:
|
Closing in favor of #488 |
Subject
Adds more specific phpdoc types, I've marked as
minor
because it was more adding missing types, but if you thinkpatch
is fine, it can be changed.There are two commits because I'm not sure about the second one. It's necessary because
AuditReader
is generic, but I'm not sure if the whole class should be generic or only some of the method 🤔I am targeting this branch, because these changes are BC.
Changelog