-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unpack object arguments as named parameters #37411
base: 2.4-develop
Are you sure you want to change the base?
Conversation
Hi @ilnytskyi. Thank you for your contribution! Add the comment under your pull request to deploy test or vanilla Magento instance:
❗ Automated tests can be triggered manually with an appropriate comment:
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
OMG wow why would unit test check config with not existing parameters for requested type and allow test to pass? Shouldn't OM work this way that it reads config from
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix failing tests
@ilnytskyi I think it was working like that in the pre-php8 era, so it kept like that due to compatibility reasons (earlier it was working by argument position, not by argument name, and you might have the wrong argument name). |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
lib/internal/Magento/Framework/ObjectManager/Test/Unit/Factory/CompiledTest.php
Outdated
Show resolved
Hide resolved
lib/internal/Magento/Framework/ObjectManager/Test/Unit/Factory/CompiledTest.php
Outdated
Show resolved
Hide resolved
lib/internal/Magento/Framework/ObjectManager/Test/Unit/Factory/CompiledTest.php
Outdated
Show resolved
Hide resolved
lib/internal/Magento/Framework/ObjectManager/Test/Unit/Factory/CompiledTest.php
Outdated
Show resolved
Hide resolved
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Functional Tests EE, Integration Tests, WebAPI Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run all tests |
Hi @ilnytskyi Thanks for the contribution! ✔️ QA Passed Install fresh Magento 2.4-develop Steps to reproduce
Before: ✖️ Execution of Array Values and Named Values. Builds are failed. Hence, moving this PR to Extended Testing. Thanks |
@magento run Unit Tests, Functional Tests EE, Functional Tests B2B |
@magento run all tests |
@magento run Functional Tests B2B |
@magento create issue |
Description (*)
Just a code clean up that uses PHP 8.1 feature of unpacking array with named params.
So
array_values
call is not needed anymore. Probably improve overrall performance by 0.01 :D as many objects will instantiate fasterRelated Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Named argumaents are actualy a bit faster based on simple check for instantiatin 100 000 objects like this

https://pastebin.com/DGdBwwzN
Contribution checklist (*)
Resolved issues: