Closed sylfabre closed 2 years ago
@sylfabre thank you for the kind words and sorry it has taken me a while to get back to you. I'm working on trying to get version 9 out so at this time, if you have a fix in userland, I'd prefer not to accept a PR for this. Primarily this is because I don't want to distract from other features and I think this will have limited impact for most of our users at present. I hope you understand and thank you very much for the offer of the PR.
@Sephster I understand that, good luck with version 9!
Hello
I'm working on leveling up my phpstan setup to level 7 and I'm struggling with my Doctrine entities implementations of your token interfaces.
My
OAuthAccessToken
entity use the following code:My entity
OAuthScope
implementsScopeEntityInterface
.It works well with phpstan Doctrine extension as
$scopes
is actually an array ofOAuthScope
that is expected by Doctrine. But it breaks contravariance and return types because the phpdoc ofAccessTokenEntityInterface
is all aboutScopeEntityInterface
.A way to correctly fix this is to use
@template
annotation as explained in https://phpstan.org/blog/generics-in-php-using-phpdocs#these-rules-are-useful%2C-but-sometimes-limitingIn my case, the required code in your package is:
and in my user-land code:
What do you think? Would you accept a PR for this?
And by the way, thank you for this amazing lib 💪