framework
framework copied to clipboard
Issue #456: Align arguments resolving in NamedArgumentsInstantiator with native PHP 8 behavior.
Q | A |
---|---|
Bugfix? | ✔️ or TBD, see changes in tests. |
Breaks BC? | ❌ or TBD, see changes in tests. |
New feature? | ❌ or TBD, see changes in tests. |
Issues | #456 |
Docs PR | (none) |
The arguments resolving in NamedArgumentsInstantiator
has some edge cases where it diverges from native behavior in PHP 8. This PR adds more test cases and attempts to align the behavior more with PHP 8.
(I might still do some tweaking with force-push)
Master branch is the 2.9.x-dev
version. Are you sure these fixes should be reserved for the next minor release instead of 2.8.x
patch?
I am splitting the big function, but I am not sure if that's really so helpful. It is nice if local variables have a limited scope. But does the split really create meaningful separation?
@SerafimArts I recommend to keep the commit history of this PR. Each commit is meant to have passing tests, so we see the effect of before/after. Only the last commit (splitting the big method) we could squash with the previous one, but we should first fine-tune.
Master branch is the 2.9.x-dev version. Are you sure these fixes should be reserved for the next minor release instead of 2.8.x patch?
Ah. Sure, I can use 2.8.x as a base instead.
Base changed.
I forgot to add a test for the variadic parameter. Going to do it now.
@donquixote It's okay, dont worry. I haven't started (as you might have noticed) the review yet.
The current code for the appendNamedArgs
function looks pretty impressive and complex, so to understand whether it can be simplified, I need to investigate its work. But since I have other tasks in my work now, I may be able to do a review either by the end or next week.
Improved test coverage and support for various edge cases.
Codecov Report
Merging #459 (71115e5) into master (195b876) will increase coverage by
0.14%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #459 +/- ##
============================================
+ Coverage 79.96% 80.11% +0.14%
- Complexity 6743 6754 +11
============================================
Files 761 761
Lines 17064 17100 +36
============================================
+ Hits 13645 13699 +54
+ Misses 3419 3401 -18
Impacted Files | Coverage Δ | |
---|---|---|
...ternal/Instantiator/NamedArgumentsInstantiator.php | 98.61% <100.00%> (+29.16%) |
:arrow_up: |
src/Attributes/src/Internal/Exception.php | 100.00% <0.00%> (+100.00%) |
:arrow_up: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.