-
Notifications
You must be signed in to change notification settings - Fork 159
Documentation for Magento2.Templates.ThisInTemplate rule #108
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
Comments
@ihor-sviziev thanks raising this question. First of all we need to define correct recommendation here. On the one hand the use of helpers is in general discouraged, on the other hand we have legacy code that requires significant refactoring in order to archive this. Do we want to change sniff behavior and allow Would you be interested in raising this question during the next architecture discussion? |
Hi @lenaorobei, |
Sure, I'll do that. |
This issue was discussed during architecture discussion magento/architecture#183. Notes:
I suggest adding documentation for I'm going to change purpose of this ticket to adding |
…MEQP2 sniffs - Decoupled MEQP2 sniffs from MEQP coding standard - Skipped false-positive and dynamic sniffs for now
…ateDoc #108 Enhance doc for ThisInTemplate rule
Added copyright verification for graphqls files
Description
Right now the only one option to use helpers inside blocks - is following code:
$this->helper(<helper_class>)
, but this Magento2.Templates.ThisInTemplate rule complains against it. As result - we have to add to ignore Magento2.Templates.ThisInTemplate in many view files.Examples:
Try to find "Magento2.Templates.ThisInTemplate" in following commit:
magento/magento2@514e3d0
Expected behavior
We should not have any complains from static tests when running valid code
Benefits
We will not have useless disabling of this rule
Additional information
Option 1: this code example should be added to exception list
Option 2: there should be developed or provided recommended solution how to avoid it
The text was updated successfully, but these errors were encountered: