Closed ondrejmirtes closed 3 months ago
I can bring back tests/PHPStan/MacroTest.php in some form if you'd want.
I'm now waiting for your feedback before finalizing this PR.
And we're green now! 👍
Please squash the commits on merge, thank you.
Thank you 🙏 💟
Nice, right? :) The main motivation for me to contribute this is for Carbon to stop using non-public facing PHPStan classes like BuiltinMethodReflection (which will be removed in PHPStan 2.0).
Thanks to ClosureTypeFactory, which allows us to create useful PHPStan Reflection objects out of Closure objects, this greatly simplified the PHPStan extension related to macros.
ClosureTypeFactory has been contributed to PHPStan by Can Vural, to support similar macros analysis in Larastan (Laravel), more than 2 years ago.
I hope you like this.