Skip to content

Documentation for Magento2.Templates.ThisInTemplate rule #108

Closed
@ihor-sviziev

Description

@ihor-sviziev

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions