Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reading phpstan/phpstan#134 and wanting to try PHPStan 0.9, I wanted to try to write the extension to make PHPStan and Prophecy work along.
I'm not an expert on PHPStan internals, so I started working on this copypasting from the MockBuilder classes, and I reached a point where the
reveal()
method is no longer an issue for PHPStan! 🎉Now, I need to tackle the issues reported when defining the expectation on a mock, and that's a lot trickier!
Scenario:
Basically you can call on the mock any method of it's base class (
ObjectProphecy
) but also any method of the mocked class (methodA
); the problem is that those methods will accept the same stuff defined bu the original signature ORTokenInterface
s from Prophecy, OR a mix of that.; also, it will return aMethodProphecy
every time.How we should tackle this?