Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [magento-ecg]

Denotes questions related to Magento ECG Coding Standard

Filter by
Sorted by
Tagged with
1
vote
2answers
642 views

Magento 2: Only dependency assignment operations are allowed in constructor. Coding standard error

"WARNING | Only dependency assignment operations are allowed in constructor. No other operations are allowed". I'm getting this warning error while checking the coding standard in Magento2 code ...
2
votes
0answers
77 views

The use of function html_entity_decode is forbidden. What should we use instead?

Ecg coding standards forbids using html_entity_decode method. What should we use instead?
10
votes
3answers
1k views

ECG compliance: How to do?

There is something like a coding standard for Magento 1, called ECG where numerous things should be avoided or methods that should not be used. Let's try to create a list that covers all cases that ...
5
votes
4answers
1k views

Alternative to file_exists() function [duplicate]

When trying to boost code quality, I frequently encounter errors like "The use of function file_exists() is forbidden" when trying to use PHP file functions. This for instance happens with the Magento ...
0
votes
1answer
60 views

How to access $_FILES in magentos way?

For ECG you should avoid using "superglobals", but is there any Magento, Zend or Varien method to replace $_FILES? Couldn't find anything in Mage_Core_Controller_Request_Http or ...
2
votes
1answer
231 views

Why does my module getting warrning “Mysql4 classes are obsolete ”

Hello i have create custom module and getting warning Mysql4 classes are obsolete class Mymodule_Custom_Model_Mysql4_Stores extends Mage_Core_Model_Mysql4_Abstract { public function ...
1
vote
2answers
244 views

ECG compliant alternative method for file_get_contents (remote XML)

What is correct "ECG-way" to load an remote XML file? For local files this works: $xml = new Varien_Simplexml_Config($configFile); $node = $xml->getNode('my/selected/node'); But not from remote ...
5
votes
1answer
2k views

Super Global SERVER Variable alternative in Magento2

I am creating extension in Magento2 and also try to follow the all coding standards that magento2 is recommending using EcgM2 standard. Can any one tell me alternative of SERVER['SERVER_NAME'] ...
30
votes
2answers
3k views

Why are so many PHP functions disallowed in the Magento ECG Coding Standard?

The Magento ECG Coding Standard seems to be (at least kind of) official as standard for Magento 1 extensions: https://github.com/magento-ecg/coding-standard But I don't understand the reasoning ...