-
Notifications
You must be signed in to change notification settings - Fork 90
AssertStatus to Dedicated Assert method #71
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
AssertStatus to Dedicated Assert method #71
Conversation
|
Test are passing, so everything seems ok :). Could you add the failing test fixture you linked on Twitter? Also, fix PHPStan errors first and run PHPStan locally. It often guides you to the fix itself :) |
|
@TomasVotruba I've created an example test, but the problem doesn't seem to be an issue other than when it's tested on a Laravel app. I might have just set up a demo Laravel app quickly to demonstrate the problem there. I've also updated the code to fix the PHPStan issues. Appreciate you looking at this. |
|
Great job 👍 The test fixture must fail here, not outside, so we have the bug covered and isolated. Try to figure out the test fixture to fail here. |
|
@TomasVotruba I've tried to understand the problem but with no luck. Ultimately, I created a Laravel project showing that the rule fails. |
|
I see you've put in the lot of effort, so I'm checking the repository to help you out 👍 For some reason, the I'd recommend same setup as Larastan has. There will be probably some magic file that you include and PHPStan will see the types. |
|
Thank you @TomasVotruba. I really appreciate the help. It's odd because, as far as I can tell, it should be picking up the return tag to know that it's a |
|
@TomasVotruba, just a heads up, I managed to fix the problem with a tweak to Larastan, but debugging PHPStan, it seems there might just be a bug with Rector? To summarise. When running PHPStan, it debugs the correct type Was curious to know if you had any thoughts on how that might of happened and how you might debug that within Rector. |
|
That's probably due to the type extensions, possibly loaded magically via phpstan/extension-installer. |
|
It isn't installed in the demo project. |
|
Thanks for your work on this @peterfox. |
|
I tested this again in the demo app you provided @peterfox, it works with and without your larastan fork. I'm going to merge this in now. Thanks 🙌 |
No description provided.