-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fixed condition with usage "hack" isPostRequest method #12626
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
Fixed condition with usage "hack" isPostRequest method #12626
Conversation
@@ -0,0 +1,52 @@ | |||
<?php | |||
/** | |||
* @author Pavel Usachev <webcodekeeper@hotmail.com> |
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.
The Signature should be:
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
@@ -0,0 +1,52 @@ | |||
<?php |
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.
What is the purpose of this Interface?
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.
This interface extends the basic interface and contains methods for determining which HTTP request used. I did not touch the original interface to not do BC break. But if we can move this "contracts" to original Request interface(https://github.com/magento/magento2/blob/56af1e73ce21867b770a7458ab6e109f4a1eface/lib/internal/Magento/Framework/App/RequestInterface.php) it is even better. Because then it will not be necessary to make checks for implementation or special annotations like "$request instance of HttpRequestInterface" or "/** @var $request HttpRequestInterface $request */"
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.
Thanks! In this case we must create new Interface to not do BC break as you say!
Thanks @pusachev for your PR, Can you squash your PR to have only one commit ? If you don't know how to squash, feel free to contact me and I will help you! |
- removed private function isPost - removed unused imports - added request method isPost - added interface that expands HTTP request class - fixed unit test in Contact module - fixed integration tests in Contact module
dae3434
to
ae09d7d
Compare
@osrecio Np! Squash done. Please check. |
Hi @ihor-sviziev, thank you for the review. |
@magento-engcom-team done |
Hi @pusachev. Thank you for your contribution. Please, consider to port this solution to 2.3 release line. |
Contribution checklist