Treat constructors as implicitly void-typed for the purposes of prependCodeToFunctions() - #214
Conversation
jrfnl
left a comment
There was a problem hiding this comment.
@antecedent I've been running the BrainMonkey tests with this branch to see whether it would fix the test failures BrainMonkey was seeing on PHP 8.6.
As things were, half the test failures were fixed. Looking at what remained showed me the oversight, namely that the same PHP RFC also forbids returning from a __destruct() method.
I've tried to fix that with the additional two commits (sorry, didn't mean to push to this branch, but as I did, the commits are here now), but while the fix works *, the test I added does not.
* The reason I'm saying the fix works is that the BrainMonkey tests pass on PHP 8.6 with the additional fix in place.
Hope this helps.
273d773 to
6aee010
Compare
|
Thank you @jrfnl! It looks like the missing link was I found it striking that Patchwork did not throw anything from the |
Yes, that would explain it. Sorry I missed that. Should we also add some tests with an anonymous class with a
If you mean that Patchwork should throw an exception when |
See #213.
The title assumes
use function Patchwork\CodeManipulation\Actions\Generic\prependCodeToFunctions.