You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it was of object there. But I removed it because of Psalm errors.
If we specify the type object, another problem arises about variance. PHPStan might be a bit weak or flex in this area, but not Psalm:
If we write @template TEntity of object, we can't use TEntity in the return type.
If we write @template-covariant TEntity of object, we can't use TEntity in parameters.
Could you provide an example where Psalm behaves differently? I copied my code into the Psalm sandbox, and it works with TEntity of object: https://psalm.dev/r/4bec47759a.
Also, why is it TEntity of object in Repository, but just TEntity in RepositoryInterface?
No duplicates 🥲.
What happened?
Could you please make a small update to
RepositoryInterface
?Change
@template TEntity
to@template TEntity of object
just like it's done inRepository
.I'm experiencing an issue with PHPStan: https://phpstan.org/r/b906c8b7-d85c-44d6-bcb0-9b7828da8d9f
I'm particularly concerned about this error:
Call to an undefined method object::getStatus().
Adding
@template TEntity of object
on line 4 resolves the issue.Thanks!
Version
The text was updated successfully, but these errors were encountered: