Skip to content

Releases: magento/magento-coding-standard

Version 6

03 Dec 14:53
efc9084
Compare
Choose a tag to compare

New Rules

  • Added sniff to prohibit imports from Magento\Tests namespace outside of tests in #149 by @konarshankar07
  • Added sniff to discourage the use of Resource class from Model class (i.e. getResource()->load($object)) in #189 by @milindsingh

Improvements

  • squizlabs/php_codesniffer dependency version updated from ^3.4 to ^3.5 for PHP 7.4 compatibility
  • Discouraged functions list was updated to include all the aliases of the existing discouraged functions in #179 by @andrewbess
  • Modified deprecated validator to allow missing the comment if see tag is set in #181 by @sinisa86

Fixes

  • Fixed issue when PHP files which contain phtml in the name were detected as templates in #180 by @sinisa86

v5 Release

05 Nov 17:10
da46c5d
Compare
Choose a tag to compare

New Rules

Improvements

  • Added check for the use of helpers in Magento2.Templates.ThisInTemplate sniff and updated documentation with recommendation #121 in #122 @diazwatson
  • Added alternatives for discouraged functions #102 in #123 by @diazwatson
  • No longer require a space before a colon for control structures using the alternative syntax #118 in #132 by @hostep
  • Add excludes for test files <exclude-pattern>*/tests/*</exclude-pattern> #136 in #138 by @konarshankar07
  • Improved documentation with How to use phpcbf in #150 by @lfluvisotto

Fixes

  • Fixed issue with false-positive Empty FUNCTION statement detected for around plugins #95 in #126 by @konarshankar07
  • Fixed issue in line length sniff for phrase and __ keyword by removing redundant rule and using generic one #75 in #127 by @konarshankar07

v4 Release

06 Aug 16:11
d24e023
Compare
Choose a tag to compare

New Rules

Improvements

Fixes

v3 Release

18 Jun 21:14
73a7b7f
Compare
Choose a tag to compare

Versioning

Starting from the current release new versioning strategy will be used. One release line will be supported based on incremental approach despite introduced changes and single number sequence-based version identifier will be incremented every release.
Please refer to the wiki page and magento/architecture#136 thread for more details.

New Rules

  • Increased the severity level to 10 for InsecureFunctionSniff #104

Improvements

  • Improved LiteralNamespacesSniff by removing class exists checks and adding exclude patterns #9 in #89 by @ldusan84
  • htmlspecialchars is added to the list of discouraged functions in #96 by @davemacaulay
  • Removed Squiz.Commenting.ClassComment from the ruleset since it does not cover all Magento cases #106
  • Added excludes for phtml files #112

Fixes

  • Undefined index: comment_closer in AbstractApiSniff.php #86 in #87 by @mzeis
  • Fixed ForeachArrayMergeSniff throws an error for inline control structure #110 in #111

2.0.0

17 Apr 21:25
e2ed8ce
Compare
Choose a tag to compare

New Rules

  • Magento2.Classes.DiscouragedDependencies detects explicit request of proxies and interceptors in constructors. #18 -> #59 by @maderlock
  • Magento2.Performance.ForeachArrayMerge detects array_merge(...) usage in a loop. #20 -> #72 by @larsroettig

Improvements

Fixes

  • */Fixtures/* exclude for rules that do not apply to test files.

Documentation

1.0.2

05 Apr 19:17
f7de26f
Compare
Choose a tag to compare
  • added test files excludes for specific rules: Magento2.Security.IncludeFile, Magento2.Security.Supergloba, Magento2.SQL.RawQuery, Magento2.Exceptions.DirectThrow, Magento2.Functions.DiscouragedFunction, Magento2.Functions.StaticFunction, Magento2.CodeAnalysis.EmptyBlock, Squiz.Functions.GlobalFunction, Squiz.PHP.GlobalKeyword, PSR1.Files.SideEffects -> fixed #80.

1.0.1

01 Apr 17:07
489029a
Compare
Choose a tag to compare
  • removed EmptyCheckSniff since there is no performance impact;
  • added more excludes for */Test/* files;
  • removed Squiz.Commenting.FunctionCommentThrowTag because it doesn't work with @inheritdoc tags.

1.0.0

27 Mar 14:19
b79055f
Compare
Choose a tag to compare

🚀 Initial release of Magento Coding Standard - the result of MEQP and Magento 2 core rules consolidation.

Magento Coding Standard covers:

• PSR2 compliance
• the use of insecure functions
• unescaped output
• the use of deprecated PHP functions
• PHP code syntax
• naming convention
• the use of PHP superglobals
• empty code blocks
• improper exception handling
• raw SQL queries
and many other general PHP and Magento 2 specific code issues.