magento-coding-standard
magento-coding-standard copied to clipboard
Magento Coding Standard
Hi! On Magento 2.4.3, I'm looking to upgrade to latest magento-coding-standard (v25), however, there's a conflict with webonyx/graphql-php. ``` "require": { "php": ">=7.3", "webonyx/graphql-php": "^14.9", ``` My Magento version is...
### Preconditions 1. Tested on Magento Open Source 2.4.4 and Adobe Commerce 2.4.4 2. PHP 8.1 (I haven't tried 7.4) 3. PHPStorm version is 2021.2.4 ### Steps to reproduce 1....
### Rule All imports are effectively used. All imports are sorted ### Reason Usually after code refactoring, some imports are not necessary anymore and should be removed and re-sorted by...
Fixes #404 If a class property has a type, then there should not be a requirement for a DocBlock. A DocBlock can still be added if desired - this change...
Fixes #407
I have recently opened a pull request on https://github.com/magento/magento2. When I ran the static analysis automated test, some complaints were raised (for unchanged parts of the files which were being...
I have noticed that this coding standard is using `PSR2.ControlStructures.ControlStructureSpacing` and `PSR12.ControlStructures.ControlStructureSpacing` is also available. From what I can tell, the latter includes checks from the former and some additional...
It makes sense to me that we should be automatically fixing problems which are able to be safely automated. Here's one case of this. I hope to be able to...
### Preconditions 1. In a template (`.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#L20 1. Magento Coding Standard version 25 ### Steps to reproduce 1. Run `phpcbf --standard=Magento2` on...
Ref https://devdocs.magento.com/guides/v2.4/coding-standards/docblock-standard-general.html#documentation-space Fixes #167