-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Use in_array
instead of array_search
+ comparison
#24886
Use in_array
instead of array_search
+ comparison
#24886
Conversation
This has some benefits, such as reducing the tasks, as well as improving the readability of the code.
Hi @carusogabriel. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
Hi @carusogabriel . Thanks for your PR. Can you check the tests details and solve the errors. |
@@ -135,6 +135,6 @@ private function validateCipherMethod($cipherMethod) | |||
); | |||
$cipherMethod = strtolower($cipherMethod); | |||
|
|||
return (false !== array_search($cipherMethod, $methods)); | |||
return in_array($cipherMethod, $methods); |
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.
I would like to replace both array_search & in_array to array_flip + isset.
Reason: magento/magento-coding-standard#143
@carusogabriel @osrecio what do you think about it?
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.
Followin the thread I think is better to usee array_flip
+ isset
.
If @carusogabriel agree with us, he can perform the changes and for me will be ready to be merged :)
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.
@osrecio I'll do it :)
Hi @carusogabriel, thank you for your contribution! |
Description (*)
This has some benefits, such as reducing the tasks, as well as improving the readability of the code.
Fixed Issues (if relevant)
None
Manual testing scenarios (*)
Not necessary
Questions or comments
Contribution checklist (*)