Closed bzikarsky closed 2 years ago
Needs to be squashed. I brainfarted and had a match
in there. :zany_face: It's now a switch
@bzikarsky I added a new PR (#197). What do you think about this?
@bzikarsky Thank you for filing this PR, some very good changes in here!
I think the original PR filed in #176 by @cdosoftei and rebased in #197 by @SimonFrings is an excellent starting point for PHP 8 support as it also adds additional tests to ensure this behavior is consistent across versions. Perhaps we can get this in first and then rebase your work with regards to intersection types in PHP 8.1 on top of this PR with some additional tests?
Either way, keep it up! :+1:
I'll rebase and add matching tests once the other MR is merged. :+1:
@bzikarsky My PR is merged. :+1: Do you plan to pick this up again or do you want me to take a look at this? :shipit:
Thanks for reminding me. I'll add it to this week's TODOs and hope that I don't get overwhelmed :-)
Rebased and slightly adjusted.
@bzikarsky Thanks for the update. 🔥 Can you add additional tests to ensure your changes work as expected?
Good point. Yes, of course.
There will only be an 8.1-only test for the intersection types though. For everything else it is just a refactoring.
Pushed additional testcases in a separate commit for reviewability - Should be squashed before merge.
@clue @WyriHaximus What are your thoughts on this?
Hi! Can this be merged and 2.9.0 tagged? Thanks! Regards!
@clue @jsor sorry to bother but can you please review? thanks a lot!
Do you want to keep the refactoring of _checkTypehint
and the feature+tests in two commits? Or do you prefer one?
Once we have this in, I'm happy to create a second PR with the changes applied to Promise v3.
Do you want to keep the refactoring of
_checkTypehint
and the feature+tests in two commits? Or do you prefer one?
I would argue that each functional changes should come with additional tests as part of the same commit. Leaving the refactoring in a separate commit sounds reasonable, but I'll leave this up to you to decide :+1:
Once we have this in, I'm happy to create a second PR with the changes applied to Promise v3.
Awesome! :+1:
I prefer the separation of refactoring and feature as well. Tests are squashed into the feature. had to rebase once more though.
From my perspective: Good to go! :+1:
PHP8's reflection API changed to make room for handling of union-types. As one of the consequences
ReflectionParameter::getClass
got marked as deprecated. This commit moves the legacy path behind a version-check for PHP versions before 8 and adds a new more complex path for PHP8+.Fixes #192.