Be notified of new releases
Create your free GitHub account today to subscribe to this repository for new releases and build software alongside 28 million developers.Sign up
Several updates for 7.1 (and some for 7.2)
See all related issues and PRs in the 7.1.2 milestone.
VariableVariablessniff to detect variables variables for which the behaviour has changed in PHP 7.0. #310 Fixes #309.
NewReturnTypeDeclarationssniff will now also sniff for non-scalar return type declarations, i.e.
selfor a class name. #323
NewLanguageConstructssniff will now also sniff for the null coalesce equal operator
??=. This operator is slated to be introduced in PHP 7.2 and PHPCS already accounts for it. #340
getReturnTypeHintToken()utility method to the
PHPCompatibility_Sniffclass to retrieve return type hints from function declarations in a cross-PHPCS-version compatible way. #323.
stripVariables()utility method to the
PHPCompatibility_Sniffclass to strip variables from interpolated text strings. #341.
☔️Additional unit tests covering previously uncovered code. #308
NewExecutionDirectivessniffs will now also correctly interpret double quoted text strings with interpolated variables. #341, #324.
NewNullableTypessniff will now also report on nullable (return) type hints when used with closures. #323
NewReturnTypeDeclarationssniff will now also report on return type hints when used with closures. #323
📌Allow for anonymous classes in the
inClassScope()utility method. #315
📌The function call parameter related utility functions can now also be used to get the individual items from an array declaration. #300 🔀The
NewScalarReturnTypeDeclarationssniff has been renamed to
ForbiddenNamessniff will now also correctly ignore anonymous classes when used in combination with PHPCS < 2.3.4. #319
NewAnonymousClassessniff will now correctly recognize and report on anonymous classes when used in combination with PHPCS < 2.5.2. #325
NewGroupUseDeclarationssniff will now correctly recognize and report on group use statements when used in combination with PHPCS < 2.6.0. #320
NewNullableTypessniff will now correctly recognize and report on nullable return types when used in combination with PHPCS < 2.6.0. #323
NewReturnTypeDeclarationssniff will now correctly recognize and report on new return types when used in combination with PHPCS < 2.6.0. #323
♻️Various (minor) refactoring for improved performance and sniff accuracy. #317 ♻️Defer to upstream
hasCondition()utility method where appropriate. #315
♻️Minor refactoring of some unit test code. #304, #303, #318 🔧All unit tests now have appropriate
@groupannotations allowing for quicker/easier testing of a select group of tests/sniffs. #305
🔧All unit tests now have appropriate
@coversannotations to improve code coverage reporting and remove bleed through of accidental coverage. #307
🔧Minor tweaks to the travis script. #322 💚The PHPCompatibility code base itself will now be checked for cross-version compatibility during build testing. #322
ConstantArraysUsingDefinesniff would throw false positives if the value of the
define()was retrieved via a function call and an array parameter was passed. #327
ForbiddenCallTimePassByReferencesniff would throw false positives on assign by reference within function calls or conditions. #302 Fixes the last two cases reported in #68
ForbiddenGlobalVariableVariableSniffsniff would only examine the first variable in a
global ...statement causing unreported issues if subsequent variables were variable variables. #316
NewKeywordssniff would throw a false positive for the
constkeyword when encountered in an interface. #312
NewNullableTypessniff would not report on nullable return types for namespaced classnames used as a type hint. #323
PregReplaceEModifiersniff would always consider the first parameter passed as a single regex, while it could also be an array of regexes. This led to false positives and potentially unreported use of the
emodifier when an array of regexes was passed. #300
PregReplaceEModifiersniff could misidentify the regex delimiter when the regex to be examined was concatenated together from various text strings taken from a compound parameter leading to false positives. #300
✅Compatibility with PHPCS 2.7.x. Deal with changed behaviour of the upstream PHP tokenizer and utility function(s). #313, #323, #326, #340
Thanks go out to Juliette Reinders Folmer for her contributions to this version.