packagist phpcsstandards/php_codesniffer 3.0.0
3.0.0 - 2017-05-04

latest releases: 4.0.x-dev, dev-master, dev-feature/tokenizer-comments-add-tests...
7 years ago

This is the first stable release of the 3.0 branch, and is a large refactoring of the code base. It breaks backwards compatibility for all custom sniffs and custom reports. An upgrade guide for sniff and report developers is available here: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Version-3.0-Upgrade-Guide

Note: If you only use the built-in coding standards (such as PEAR or PSR2), or you have a custom ruleset.xml file that only makes use of the sniffs and reports distributed with PHP_CodeSniffer, you do not need to make any changes to begin using the 3.0.0 version.

There are no future planned releases for the 2.x branch, but there may still be additional 2.9.x versions released for a time due to the number of changes required to upgrade custom sniffs for 3.0. The intention is to limit 2.9.x releases to serious bug and security fixes only.

Changes since 3.0.0RC4

  • Added an --ignore-annotations command line argument to ignore all @codingStandards annotations in code comments (request #811)
    • This allows you to force errors to be shown that would otherwise be ignored by code comments
    • Also stop files being able to change sniff properties mid way through processing
  • An error is now reported if no sniffs were registered to be run (request #1129)
  • The autoloader will now search for files inside the directory of any loaded coding standard
    • This allows autoloading of any file inside a custom coding standard without manually requiring them
    • Ensure your namespace begins with your coding standard's directory name and follows PSR-4
    • e.g., StandardName\Sniffs\CategoryName\AbstractHelper or StandardName\Helpers\StringSniffHelper
  • Fixed an error where STDIN was sometimes not checked when using the --parallel CLI option
  • The is_closure index has been removed from the return value of File::getMethodProperties()
    • This value was always false becasue T_FUNCTION tokens are never closures
    • Closures have a token type of T_CLOSURE
  • The File::isAnonymousFunction() method has been removed
    • This function always returned false because it only accepted T_FUNCTION tokens, which are never closures
    • Closures have a token type of T_CLOSURE
  • Includes all changes from the 2.9.0 release
  • Fixed bug #834 : PSR2.ControlStructures.SwitchDeclaration does not handle if branches with returns
    • Thanks to Fabian Wiget for the patch

Changes since 2.x

For a full list of changes from the 2.x version, please review the following changelogs:
https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.0.0a1
https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.0.0RC1
https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.0.0RC2
https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.0.0RC3
https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.0.0RC4

Don't miss a new php_codesniffer release

NewReleases is sending notifications on new releases.