magento-coding-standard
magento-coding-standard copied to clipboard
Magento Coding Standard
### Rule * A plugin class should have a `@see` annotation to the class(es) that it is intercepting. * Each plugin method should have a `@see` annotation to the method(s)...
### Rule I saw a warning similar to this in my IDE the other day: ``` The use of function filectime() / filemtime() is discouraged. ``` It was not coming...
### Problem Overview Some of the rules like `strict_types` were introduced in later Magento versions and are not applicable to earlier ones. Magento Marketplace still checks the code of extensions...
### Description As a developer I develop some code and running magento coding standard static tests against my code. But it's not clear what to do in case of some...
### Rule According to [this page](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/service-contracts/service-to-web-service.html) there are some very specific rules for service contracts. For example: - Valid object types include a fully qualified class name or a fully...
### Description All rules that do not apply on test files need to have one more exclude. ``` xml */tests/* ``` ### AC - Rules contain additional exclude. - Additional...
### Preconditions N/A ### Steps to reproduce 1. Make PR to Magento with changed file, that don't have like about ignoring discouraged pathinfo function or run magneto coding standard against...
### Background When creating a Block class, a Block class could set its PHTML template in multiple ways: Through XML layout, through a call to `$this->setTemplate()` and through a variable...
### Description `Magento2.Classes.ObjectInstantiation` Detects direct object instantiation via `new` keyword. The test run of `Magento2.Classes.ObjectInstantiation` rule againstMagento2 codebase found >2000 issues. Some of them look like false-positive. Examples: ``` Direct...
This PR adds eliminated classes of Zend Framework 1 to Magento Coding Standards in RestrictedCodeSniff of Legacy checking