Releases: PHPCSStandards/PHP_CodeSniffer
3.1.0 - 2017-09-20
Unit Test Changes
- This release includes a change to support newer versions of PHPUnit (versions 4, 5, and 6 are now supported)
- The custom PHP_CodeSniffer test runner now requires a bootstrap file
- Developers with custom standards using the PHP_CodeSniffer test runner will need to do one of the following:
- run your unit tests from the PHP_CodeSniffer root dir so the bootstrap file is included
- specify the PHP_CodeSniffer bootstrap file on the command line:
phpunit --bootstrap=/path/to/phpcs/tests/bootstrap.php
- require the PHP_CodeSniffer bootstrap file from your own bootstrap file
- If you don't run PHP_CodeSniffer unit tests, this change will not affect you
- Thanks to Juliette Reinders Folmer for the patch
Other Changes
- A
phpcs.xml
orphpcs.xml.dist
file now takes precedence over the default_standard config setting- Thanks to Björn Fischer for the patch
- Both
phpcs.xml
andphpcs.xml.dist
files can now be prefixed with a dot (request #1566)- The order that the files are searched is:
.phpcs.xml
,.phpcs.xml.dist
,phpcs.xml
,phpcs.xml.dist
- The order that the files are searched is:
- The autoloader will now search for files during unit tests runs from the same locations as during normal phpcs runs
- Allows for easier unit testing of custom standards that use helper classes or custom namespaces
- Include patterns for sniffs now use
OR
logic instead ofAND
logic- Previously, a file had to be in each of the include patterns to be processed by a sniff
- Now, a file has to only be in at least one of the patterns
- This change reflects the original intention of the feature
- PHPCS will now follow symlinks under the list of checked directories
- This previously only worked if you specified the path to a symlink on the command line
- Output from
--config-show
,--config-set
, and--config-delete
now includes the path to the loaded config file - PHPCS now cleanly exits if its config file is not readable
- Previously, a combination of PHP notices and PHPCS errors would be generated
- Comment tokens that start with
/**
are now always tokenized as docblocks- Thanks to Michał Bundyra for the patch
- The PHP-supplied
T_YIELD
andT_YIELD_FROM
tokens have been replicated for older PHP versions- Thanks to Michał Bundyra for the patch
- Added new
Generic.CodeAnalysis.AssignmentInCondition
sniff to warn about variable assignments inside conditions- Thanks to Juliette Reinders Folmer for the contribution
- Added
Generic.Files.OneObjectStructurePerFile
sniff to ensure there is a single class/interface/trait per file- Thanks to Mponos George for the contribution
- Function call sniffs now check variable function names and self/static object creation
- Specific sniffs are
Generic.Functions.FunctionCallArgumentSpacing
,PEAR.Functions.FunctionCallSignature
, andPSR2.Methods.FunctionCallSignature
- Thanks to Michał Bundyra for the patch
- Specific sniffs are
Generic.Files.LineLength
can now be configured to ignore all comment lines, no matter their length- Set the
ignoreComments
property toTRUE
(default isFALSE
) in yourruleset.xml
file to enable this - Thanks to Juliette Reinders Folmer for the patch
- Set the
Generic.PHP.LowerCaseKeyword
now checks self, parent, yield, yield from, and closure (function) keywords- Thanks to Michał Bundyra for the patch
PEAR.Functions.FunctionDeclaration
now removes a blank line if it creates one by moving the curly brace during fixingSquiz.Commenting.FunctionCommentThrowTag
now supports PHP 7.1 multi catch exceptionsSquiz.Formatting.OperatorBracket
no longer throws errors for PHP 7.1 multi catch exceptionsSquiz.Commenting.LongConditionClosingComment
now supports finally statementsSquiz.Formatting.OperatorBracket
now correctly fixes pipe separated flagsSquiz.Formatting.OperatorBracket
now correctly fixes statements containing short array syntaxSquiz.PHP.EmbeddedPhp
now properly fixes cases where the only content in an embedded PHP block is a comment- Thanks to Juliette Reinders Folmer for the patch
Squiz.WhiteSpace.ControlStructureSpacing
now ignores comments when checking blank lines at the top of control structuresSquiz.WhiteSpace.ObjectOperatorSpacing
now detects and fixes spaces around double colons- Thanks to Julius Šmatavičius for the patch
Squiz.WhiteSpace.MemberVarSpacing
can now be configured to check any number of blank lines between member vars- Set the
spacing
property (default is1
) in yourruleset.xml
file to set the spacing
- Set the
Squiz.WhiteSpace.MemberVarSpacing
can now be configured to check a different number of blank lines before the first member var- Set the
spacingBeforeFirst
property (default is1
) in yourruleset.xml
file to set the spacing
- Set the
- Added a new
PHP_CodeSniffer\Util\Tokens::$ooScopeTokens
static member var for quickly checking object scope- Includes
T_CLASS
,T_ANON_CLASS
,T_INTERFACE
, andT_TRAIT
- Thanks to Juliette Reinders Folmer for the patch
- Includes
PHP_CodeSniffer\Files\File::findExtendedClassName()
now supports extended interfaces- Thanks to Martin Hujer for the patch
- Fixed bug #1550 : Squiz.Commenting.FunctionComment false positive when function contains closure
- Fixed bug #1577 : Generic.InlineControlStructureSniff breaks with a comment between body and condition in do while loops
- Fixed bug #1581 : Sniffs not loaded when one-standard directories are being registered in installed_paths
- Fixed bug #1591 : Autoloader failing to load arbitrary files when installed_paths only set via a custom ruleset
- Fixed bug #1605 : Squiz.WhiteSpace.OperatorSpacing false positive on unary minus after comment
- Thanks to Juliette Reinders Folmer for the patch
- Fixed bug #1615 : Uncaught RuntimeException when phpcbf fails to fix files
- Fixed bug #1637 : Generic.WhiteSpaceScopeIndent closure argument indenting incorrect with multi-line strings
- Fixed bug #1638 : Squiz.WhiteSpace.ScopeClosingBrace closure argument indenting incorrect with multi-line strings
- Fixed bug #1640 : Squiz.Strings.DoubleQuoteUsage replaces tabs with spaces when fixing
- Thanks to Juliette Reinders Folmer for the patch
3.0.2 - 2017-07-18
- Fixed a problem where the source report was not printing the correct number of errors found
- Fixed a problem where the
--cache=/path/to/cachefile
CLI argument was not working - The code report now gracefully handles tokenizer exceptions
- The phpcs and phpcbf scripts are now the only places that exit() in the code
- This allows for easier usage of core PHPCS functions from external scripts
- If you are calling
Runner::runPHPCS()
orRunner::runPHPCBF()
directly, you will get back the full range of exit codes - If not, catch the new
DeepExitException
to get the error message ($e->getMessage()
) and exit code ($e->getCode()
)
- NOWDOC tokens are now considered conditions, just as HEREDOC tokens are
- This makes it easier to find the start and end of a NOWDOC from any token within it
- Thanks to Michał Bundyra for the patch
- Custom autoloaders are now only included once in case multiple standards are using the same one
- Thanks to Juliette Reinders Folmer for the patch
- Improved tokenizing of fallthrough CASE and DEFAULT statements that share a closing statement and use curly braces
- Improved the error message when Squiz.ControlStructures.ControlSignature detects a newline after the closing parenthesis
- Fixed bug #1465 : Generic.WhiteSpace.ScopeIndent reports incorrect errors when indenting double arrows in short arrays
- Fixed bug #1478 : Indentation in fallthrough CASE that contains a closure
- Fixed bug #1497 : Fatal error if composer prepend-autoloader is set to false
- Thanks to Kunal Mehta for the patch
- Fixed bug #1503 : Alternative control structure syntax not always recognized as scoped
- Fixed bug #1523 : Fatal error when using the
--suffix
argument- Thanks to Juliette Reinders Folmer for the patch
- Fixed bug #1526 : Use of basepath setting can stop PHPCBF being able to write fixed files
- Fixed bug #1530 : Generic.WhiteSpace.ScopeIndent can increase indent too much for lines within code blocks
- Fixed bug #1547 : Wrong token type for backslash in use function
- Thanks to Michał Bundyra for the patch
- Fixed bug #1549 : Squiz.PHP.EmbeddedPhp fixer conflict with
// comment
before PHP close tag- Thanks to Juliette Reinders Folmer for the patch
- Fixed bug #1560 : Squiz.Commenting.FunctionComment fatal error when fixing additional param comment lines that have no indent
3.0.1 - 2017-06-14
Security Advisory
- This release contains a fix for a security advisory related to the improper handling of a shell command
- A properly crafted filename would allow for arbitrary code execution when using the
--filter=gitmodified
command line option - All version 3 users are encouraged to upgrade to this version, especially if you are checking 3rd-party code
- e.g., you run PHPCS over libraries that you did not write
- e.g., you provide a web service that runs PHPCS over user-uploaded files or 3rd-party repositories
- e.g., you allow external tool paths to be set by user-defined values
- If you are unable to upgrade but you check 3rd-party code, ensure you are not using the Git modified filter
- This advisory does not affect PHP_CodeSniffer version 2.
- Thanks to Sergei Morozov for the report and patch
- A properly crafted filename would allow for arbitrary code execution when using the
Other Changes
- Arguments on the command line now override or merge with those specified in a ruleset.xml file in all cases
- PHPCS now stops looking for a phpcs.xml file as soon as one is found, favoring the closest one to the current dir
- Added missing help text for the
--stdin-path
CLI option to--help
- Re-added missing help text for the
--file-list
and--bootstrap
CLI options to--help
Runner::runPHPCS()
andRunner::runPHPCBF()
now return an exit code instead of exiting directly (request #1484)- The Squiz standard now enforces short array syntax by default
- The autoloader is now working correctly with classes created with
class_alias()
- The autoloader will now search for files inside all directories in the installed_paths config var
- This allows autoloading of files inside included custom coding standards without manually requiring them
- You can now specify a namespace for a custom coding standard, used by the autoloader to load non-sniff helper files
- Also used by the autoloader to help other standards directly include sniffs for your standard
- Set the value to the namespace prefix you are using for sniff files (everything up to
\Sniffs\
) - e.g., if your namespace format is
MyProject\CS\Standard\Sniffs\Category
set the namespace toMyProject\CS\Standard
- If omitted, the namespace is assumed to be the same as the directory name containing the ruleset.xml file
- The namespace is set in the ruleset tag of the ruleset.xml file
- e.g.,
<ruleset name="My Coding Standard" namespace="MyProject\CS\Standard">
- Rulesets can now specify custom autoloaders using the new autoload tag
- Autoloaders are included while the ruleset is being processed and before any custom sniffs are included
- Allows for very custom autoloading of helper classes well before the bootstrap files are included
- The PEAR standard now includes Squiz.Commenting.DocCommentAlignment
- It previously broke comments onto multiple lines, but didn't align them
- Fixed a problem where excluding a message from a custom standard's own sniff would exclude the whole sniff
- This caused some PSR2 errors to be under-reported
- Fixed bug #1442 : T_NULLABLE detection not working for nullable parameters and return type hints in some cases
- Fixed bug #1447 : Running the unit tests with a phpunit config file breaks the test suite
- Unknown arguments were not being handled correctly, but are now stored in
$config->unknown
- Unknown arguments were not being handled correctly, but are now stored in
- Fixed bug #1449 : Generic.Classes.OpeningBraceSameLine doesn't detect comment before opening brace
- Thanks to Juliette Reinders Folmer for the patch
- Fixed bug #1450 : Coding standard located under an installed_path with the same directory name throws an error
- Thanks to Juliette Reinders Folmer for the patch
- Fixed bug #1451 : Sniff exclusions/restrictions dont work with custom sniffs unless they use the PHP_CodeSniffer NS
- Fixed bug #1454 : Squiz.WhiteSpace.OperatorSpacing is not checking spacing on either side of a short ternary operator
- Thanks to Mponos George for the patch
- Fixed bug #1495 : Setting an invalid installed path breaks all commands
- Fixed bug #1496 : Squiz.Strings.DoubleQuoteUsage not unescaping dollar sign when fixing
- Thanks to Michał Bundyra for the patch
- Fixed bug #1501 : Interactive mode is broken
- Fixed bug #1504 : PSR2.Namespaces.UseDeclaration hangs fixing use statement with no trailing code
2.9.1 - 2017-05-22
3.0.0 - 2017-05-04
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
2.9.0 - 2017-05-04
- Added Generic.Debug.ESLint sniff to run ESLint over JS files and report errors
- Set eslint path using: phpcs --config-set eslint_path /path/to/eslint
- Thanks to Ryan McCue for the contribution
- T_POW is now properly considered an arithmetic operator, and will be checked as such
- Thanks to Juliette Reinders Folmer for the patch
- T_SPACESHIP and T_COALESCE are now properly considered comparison operators, and will be checked as such
- Thanks to Juliette Reinders Folmer for the patch
- Generic.PHP.DisallowShortOpenTag now warns about possible short open tags even when short_open_tag is set to OFF
- Thanks to Juliette Reinders Folmer for the patch
- Generic.WhiteSpace.DisallowTabIndent now finds and fixes improper use of spaces anywhere inside the line indent
- Previously, only the first part of the indent was used to determine the indent type
- Thanks to Juliette Reinders Folmer for the patch
- PEAR.Commenting.ClassComment now supports checking of traits as well as classes and interfaces
- Thanks to Juliette Reinders Folmer for the patch
- Squiz.Commenting.FunctionCommentThrowTag now supports re-throwing exceptions (request #946)
- Thanks to Samuel Levy for the patch
- Squiz.PHP.DisallowMultipleAssignments now ignores PHP4-style member var assignments
- Thanks to Juliette Reinders Folmer for the patch
- Squiz.WhiteSpace.FunctionSpacing now ignores spacing above functions when they are preceded by inline comments
- Stops conflicts between this sniff and comment spacing sniffs
- Squiz.WhiteSpace.OperatorSpacing no longer checks the equal sign in declare statements
- Thanks to Juliette Reinders Folmer for the patch
- Added missing error codes for a couple of sniffs so they can now be customised as normal
- Fixed bug #1266 : PEAR.WhiteSpace.ScopeClosingBrace can throw an error while fixing mixed PHP/HTML
- Fixed bug #1364 : Yield From values are not recognised as returned values in Squiz FunctionComment sniff
- Fixed bug #1373 : Error in tab expansion results in white-space of incorrect size
- Thanks to Mark Clements for the patch
- Fixed bug #1381 : Tokenizer: derefencing incorrectly identified as short array
- Fixed bug #1387 : Squiz.ControlStructures.ControlSignature does not handle alt syntax when checking space after closing brace
- Fixed bug #1392 : Scope indent calculated incorrectly when using array destructuring
- Fixed bug #1394 : integer type hints appearing as TypeHintMissing instead of ScalarTypeHintMissing
- PHP 7 type hints were also being shown when run under PHP 5 in some cases
- Fixed bug #1405 : Squiz.WhiteSpace.ScopeClosingBrace fails to fix closing brace within indented PHP tags
- Fixed bug #1421 : Ternaries used in constant scalar expression for param default misidentified by tokenizer
- Fixed bug #1431 : PHPCBF can't fix short open tags when they are not followed by a space
- Thanks to Gonçalo Queirós for the patch
- Fixed bug #1432 : PHPCBF can make invalid fixes to inline JS control structures that make use of JS objects
3.0.0RC4 - 2017-03-01
Security Advisory
- This release contains a fix for a security advisory related to the improper handling of shell commands
- Uses of shell_exec() and exec() were not escaping filenames and configuration settings in most cases
- A properly crafted filename or configuration option would allow for arbitrary code execution when using some features
- All users are encouraged to upgrade to this version, especially if you are checking 3rd-party code
- e.g., you run PHPCS over libraries that you did not write
- e.g., you provide a web service that runs PHPCS over user-uploaded files or 3rd-party repositories
- e.g., you allow external tool paths to be set by user-defined values
- If you are unable to upgrade but you check 3rd-party code, ensure you are not using the following features:
- The diff report
- The notify-send report
- The Generic.PHP.Syntax sniff
- The Generic.Debug.CSSLint sniff
- The Generic.Debug.ClosureLinter sniff
- The Generic.Debug.JSHint sniff
- The Squiz.Debug.JSLint sniff
- The Squiz.Debug.JavaScriptLint sniff
- The Zend.Debug.CodeAnalyzer sniff
- Thanks to Klaus Purer for the report
Other Changes
- The indent property of PEAR.Classes.ClassDeclaration has been removed
- Instead of calculating the indent of the brace, it just ensures the brace is aligned with the class keyword
- Other sniffs can be used to ensure the class itself is indented correctly
- Invalid exclude rules inside a ruleset.xml file are now ignored instead of potentially causing out of memory errors
- Using the -vv command line argument now also shows the invalid exclude rule as XML
- Includes all changes from the 2.8.1 release
- Fixed bug #1333 : The new autoloader breaks some frameworks with custom autoloaders
- Fixed bug #1334 : Undefined offset when explaining standard with custom sniffs
2.8.1 - 2017-03-01
Security Advisory
- This release contains a fix for a security advisory related to the improper handling of shell commands
- Uses of shell_exec() and exec() were not escaping filenames and configuration settings in most cases
- A properly crafted filename or configuration option would allow for arbitrary code execution when using some features
- All users are encouraged to upgrade to this version, especially if you are checking 3rd-party code
- e.g., you run PHPCS over libraries that you did not write
- e.g., you provide a web service that runs PHPCS over user-uploaded files or 3rd-party repositories
- e.g., you allow external tool paths to be set by user-defined values
- If you are unable to upgrade but you check 3rd-party code, ensure you are not using the following features:
- The diff report
- The notify-send report
- The Generic.PHP.Syntax sniff
- The Generic.Debug.CSSLint sniff
- The Generic.Debug.ClosureLinter sniff
- The Generic.Debug.JSHint sniff
- The Squiz.Debug.JSLint sniff
- The Squiz.Debug.JavaScriptLint sniff
- The Zend.Debug.CodeAnalyzer sniff
- Thanks to Klaus Purer for the report
Other Changes
- The PHP-supplied T_COALESCE_EQUAL token has been replicated for PHP versions before 7.2
- PEAR.Functions.FunctionDeclaration now reports an error for blank lines found inside a function declaration
- PEAR.Functions.FunctionDeclaration no longer reports indent errors for blank lines in a function declaration
- Squiz.Functions.MultiLineFunctionDeclaration no longer reports errors for blank lines in a function declaration
- It would previously report that only one argument is allowed per line
- Squiz.Commenting.FunctionComment now corrects multi-line param comment padding more accurately
- Squiz.Commenting.FunctionComment now properly fixes pipe-separated param types
- Squiz.Commenting.FunctionComment now works correctly when function return types also contain a comment
- Thanks to Juliette Reinders Folmer for the patch
- Squiz.ControlStructures.InlineIfDeclaration now supports the elvis operator
- As this is not a real PHP operator, it enforces no spaces between ? and : when the THEN statement is empty
- Squiz.ControlStructures.InlineIfDeclaration is now able to fix the spacing errors it reports
- Fixed bug #1340 : STDIN file contents not being populated in some cases
- Thanks to David Biňovec for the patch
- Fixed bug #1344 : PEAR.Functions.FunctionCallSignatureSniff throws error for blank comment lines
- Fixed bug #1347 : PSR2.Methods.FunctionCallSignature strips some comments during fixing
- Thanks to Algirdas Gurevicius for the patch
- Fixed bug #1349 : Squiz.Strings.DoubleQuoteUsage.NotRequired message is badly formatted when string contains a CR newline char
- Thanks to Algirdas Gurevicius for the patch
- Fixed bug #1350 : Invalid Squiz.Formatting.OperatorBracket error when using namespaces
- Fixed bug #1369 : Empty line in multi-line function declaration cause infinite loop
3.0.0RC3 - 2017-02-02
- Added support for ES6 class declarations
- Previously, these class were tokenized as JS objects but are now tokenized as normal T_CLASS structures
- Added support for ES6 method declarations, where the "function" keyword is not used
- Previously, these methods were tokenized as JS objects (fixes bug #1251)
- The name of the ES6 method is now assigned the T_FUNCTION keyword and treated like a normal function
- Custom sniffs that support JS and listen for T_FUNCTION tokens can't assume the token represents the word "function"
- Check the contents of the token first, or use $phpcsFile->getDeclarationName($stackPtr) if you just want its name
- There is no change for custom sniffs that only check PHP code
- PHPCBF exit codes have been changed so they are now more useful (request #1270)
- Exit code 0 is now used to indicate that no fixable errors were found, and so nothing was fixed
- Exit code 1 is now used to indicate that all fixable errors were fixed correctly
- Exit code 2 is now used to indicate that PHPCBF failed to fix some of the fixable errors it found
- Exit code 3 is now used for general script execution errors
- Added PEAR.Commenting.FileComment.ParamCommentAlignment to check alignment of multi-line param comments
- Includes all changes from the 2.8.0 release
- Fixed an issue where excluding a file using a @codingStandardsIgnoreFile comment would produce errors
- For PHPCS, it would show empty files being processed
- For PHPCBF, it would produce a PHP error
- Fixed bug #1233 : Can't set config data inside ruleset.xml file
- Fixed bug #1241 : CodeSniffer.conf not working with 3.x PHAR file
2.8.0 - 2017-02-02
- The Internal.NoCodeFound error is no longer generated for content sourced from STDIN
- This should stop some Git hooks generating errors because PHPCS is trying to process the refs passed on STDIN
- Squiz.Commenting.DocCommentAlignment now checks comments on class properties defined using the VAR keyword
- Thanks to Klaus Purer for the patch
- The getMethodParameters() method now recognises "self" as a valid type hint
- The return array now contains a new "content" index containing the raw content of the param definition
- Thanks to Juliette Reinders Folmer for the patch
- The getMethodParameters() method now supports nullable types
- The return array now contains a new "nullable_type" index set to true or false for each method param
- Thanks to Juliette Reinders Folmer for the patch
- The getMethodParameters() method now supports closures
- Thanks to Juliette Reinders Folmer for the patch
- Added more guard code for JS files with syntax errors (request #1271 and request #1272)
- Added more guard code for CSS files with syntax errors (request #1304)
- PEAR.Commenting.FunctionComment fixers now correctly handle multi-line param comments
- AbstractVariableSniff now supports anonymous classes
- Thanks to Juliette Reinders Folmer for the patch
- Generic.NamingConventions.ConstructorName and PEAR.NamingConventions.ValidVariable now support anonymous classes
- Generic.NamingConventions.CamelCapsFunctionName and PEAR.NamingConventions.ValidFunctionName now support anonymous classes
- Thanks to Juliette Reinders Folmer for the patch
- Generic.CodeAnalysis.UnusedFunctionParameter and PEAR.Functions.ValidDefaultValue now support closures
- Thanks to Juliette Reinders Folmer for the patch
- PEAR.NamingConventions.ValidClassName and Squiz.Classes.ValidClassName now support traits
- Thanks to Juliette Reinders Folmer for the patch
- Generic.Functions.FunctionCallArgumentSpacing now supports closures other PHP-provided functions
- Thanks to Algirdas Gurevicius for the patch
- Fixed an error where a nullable type character was detected as an inline then token
- A new T_NULLABLE token has been added to represent the ? nullable type character
- Thanks to Jaroslav Hanslík for the patch
- Squiz.WhiteSpace.SemicolonSpacing no longer removes comments while fixing the placement of semicolons
- Thanks to Algirdas Gurevicius for the patch
- Fixed bug #1230 : JS tokeniser incorrectly tokenises bitwise shifts as comparison
- Thanks to Ryan McCue for the patch
- Fixed bug #1237 : Uninitialized string offset in PHP Tokenizer on PHP 5.2
- Fixed bug #1239 : Warning when static method name is 'default'
- Fixed bug #1240 : False positive for function names starting with triple underscore
- Thanks to Juliette Reinders Folmer for the patch
- Fixed bug #1245 : SELF is not recognised as T_SELF token in: return new self
- Fixed bug #1246 : A mix of USE statements with and without braces can cause the tokenizer to mismatch brace tokens
- Thanks to Michał Bundyra for the patch
- Fixed bug #1249 : GitBlame report requires a .git directory
- Fixed bug #1252 : Squiz.Strings.ConcatenationSpacing fix creates syntax error when joining a number to a string
- Fixed bug #1253 : Generic.ControlStructures.InlineControlStructure fix creates syntax error fixing if-try/catch
- Fixed bug #1255 : Inconsistent indentation check results when ELSE on new line
- Fixed bug #1257 : Double dash in CSS class name can lead to "Named colours are forbidden" false positives
- Fixed bug #1260 : Syntax errors not being shown when error_prepend_string is set
- Thanks to Juliette Reinders Folmer for the patch
- Fixed bug #1264 : Array return type hint is sometimes detected as T_ARRAY_HINT instead of T_RETURN_TYPE
- Thanks to Jaroslav Hanslík for the patch
- Fixed bug #1265 : ES6 arrow function raises unexpected operator spacing errors
- Fixed bug #1267 : Fixer incorrectly handles filepaths with repeated dir names
- Thanks to Sergey Ovchinnikov for the patch
- Fixed bug #1276 : Commenting.FunctionComment.InvalidReturnVoid conditional issue with anonymous classes
- Fixed bug #1277 : Squiz.PHP.DisallowMultipleAssignments.Found error when var assignment is on the same line as an open tag
- Fixed bug #1284 : Squiz.Arrays.ArrayBracketSpacing.SpaceBeforeBracket false positive match for short list syntax