-
Notifications
You must be signed in to change notification settings - Fork 160
AC-678: Create phpcs sniff for ObsoleteResponseTest #311
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
AC-678: Create phpcs sniff for ObsoleteResponseTest #311
Conversation
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 for the PR @eliseacornejo ! Please see my comment
foreach ($this->obsoleteResponseMethods as $method) { | ||
if ($tokens[$stringPos]['content'] === $method) { | ||
$phpcsFile->addWarning( | ||
sprintf('Contains obsolete response method: %s.', $method), |
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.
It may be not clear how these static tests failures should be addressed. Can we add a bit more information and replacement suggestion to the message:
I.e. "\Magento\Framework\App\ViewInterface::renderLayout method is deprecated. Please use \Magento\Framework\Controller\ResultInterface::renderResult instead."
...
"\Magento\Framework\App\Action\Action::_redirect" method is deprecated. Please use \Magento\Backend\Model\View\Result\Redirect instead.
...
"\Magento\Backend\App\AbstractAction::_addBreadcrumb method is deprecated. Please use \Magento\Backend\Model\View\Result\Page::addBreadcrumb instead."
and so on
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 think this can be implemented by having $obsoleteResponseMethods
as associative array
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.
Done, please @sivaschenko review! thanks
@magento import pr to magento-commerce/magento-coding-standard |
@eliseacornejo the Pull Request is successfully imported. |
No description provided.