You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have no problem with the warning / message that says that helpers are deprecated / should not be used. I have no problem with the warning / message that says that one should use $block->getThing() not $this->getThing() in templates. I have no problem with the auto-fix of $this->getThing() to $block->getThing().
This bug is for when $this->helper() gets replaced automatically with $block->helper(), which results in a broken template. (The automatic replacement of $this->getThing() with $block->getThing() is fine and the template works just fine with this change.)
I understand, and agree but my point was that they probably won’t do
anything about it since they consider this is a not a correct approach.
For my projects, I simply run the fixer with that rule excluded. But of
course that means it won’t fix other $this cases..
Preconditions
.phtml
file), make use of$this->helper(SomeClass:class);
. For example, https://github.com/magento/magento2/blob/2.4.4/app/code/Magento/Catalog/view/frontend/templates/product/listing.phtml#L20Steps to reproduce
phpcbf --standard=Magento2
on templateExpected result
Actual result
Invalid method Vendor\Module\Block\SomeBlockClass\Interceptor::helper
The text was updated successfully, but these errors were encountered: