-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Bug: return type resolving #57
Comments
Hi, When you typehint Because you define If you typehint The solution is to ask in a few places (like ObjectRepositoryDynamicReturnTypeExtension) to ask for the real method return typehint before inferring it's going to be |
One more side-effect of not typehinting |
Maybe a fix is easier thank explanation :) f7ce984 Thanks! |
Released as 0.11.2 :) https://github.com/phpstan/phpstan-doctrine/releases/tag/0.11.2 |
Works on example repo! Will try it now on original project |
OK, now it reports the problem properly! Thank you very much, I owe you some 🍽 or 🍻 next time we see each other |
Btw you should also include rules.neon in your project, not just
extension.neon 😊
On Mon, 11 Mar 2019 at 13:53, Miro Svrtan ***@***.***> wrote:
OK, now it reports the problem properly! Thank you very much, I owe you
some 🍽 or 🍻 next time we see each other
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#57 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGZuBOSSd73Z__j-RsXRHo2ZaHTyGRCks5vVlHAgaJpZM4boMpf>
.
--
Ondřej Mirtes
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi,
I'we just noticed that when using 'phpstan-doctrine' extension, there is a weird
behaviour
/bug
withfindOneBy
methods: doesnt report error on calling non-existing method.As a proof of concept (not able to share project I work on): https://github.com/msvrtan/phpstan-bug`
When calling a method
findOneByUuid
, it doesnt understand it's getting aCustomer|null
back but when callingfindXOneByUuid
it does: https://travis-ci.com/msvrtan/phpstan-bug/jobs/183766249I'we also created a PR msvrtan/phpstan-bug#2 that fails https://travis-ci.com/msvrtan/phpstan-bug/builds/103870199 once I remove that Repository does extend EntityRepository...
On the other hand, if I do 'inject' repository as
it does report ...
I know this would be a quick 'fix' to go thru codebase and add those docblocks but it still feels like unexpected behaviour
The text was updated successfully, but these errors were encountered: