@wimg wimg released this Feb 17, 2017 · 744 commits to master since this release

Assets 2

Several updates for 7.1 (and some for 7.2)

See all related issues and PRs in the 7.1.2 milestone.

Added

  • 🌟 New VariableVariables sniff to detect variables variables for which the behaviour has changed in PHP 7.0. #310 Fixes #309.
  • ⭐️ The NewReturnTypeDeclarations sniff will now also sniff for non-scalar return type declarations, i.e. array, callable, self or a class name. #323
  • ⭐️ The NewLanguageConstructs sniff 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
  • ⭐️ New getReturnTypeHintToken() utility method to the PHPCompatibility_Sniff class to retrieve return type hints from function declarations in a cross-PHPCS-version compatible way. #323.
  • ⭐️ New stripVariables() utility method to the PHPCompatibility_Sniff class to strip variables from interpolated text strings. #341.
  • β˜”οΈ Additional unit tests covering previously uncovered code. #308

Changed

  • πŸ“Œ The MbstringReplaceEModifier, PregReplaceEModifier and NewExecutionDirectives sniffs will now also correctly interpret double quoted text strings with interpolated variables. #341, #324.
  • πŸ“Œ The NewNullableTypes sniff will now also report on nullable (return) type hints when used with closures. #323
  • πŸ“Œ The NewReturnTypeDeclarations sniff 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 NewScalarReturnTypeDeclarations sniff has been renamed to NewReturnTypeDeclarations. #323
  • βͺ The ForbiddenNames sniff will now also correctly ignore anonymous classes when used in combination with PHPCS < 2.3.4. #319
  • βͺ The NewAnonymousClasses sniff will now correctly recognize and report on anonymous classes when used in combination with PHPCS < 2.5.2. #325
  • βͺ The NewGroupUseDeclarations sniff will now correctly recognize and report on group use statements when used in combination with PHPCS < 2.6.0. #320
  • βͺ The NewNullableTypes sniff will now correctly recognize and report on nullable return types when used in combination with PHPCS < 2.6.0. #323
  • βͺ The NewReturnTypeDeclarations sniff 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 @group annotations allowing for quicker/easier testing of a select group of tests/sniffs. #305
  • πŸ”§ All unit tests now have appropriate @covers annotations 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

Fixed

  • πŸ› The ConstantArraysUsingDefine sniff would throw false positives if the value of the define() was retrieved via a function call and an array parameter was passed. #327
  • πŸ› The ForbiddenCallTimePassByReference sniff would throw false positives on assign by reference within function calls or conditions. #302 Fixes the last two cases reported in #68
  • πŸ› The ForbiddenGlobalVariableVariableSniff sniff would only examine the first variable in a global ... statement causing unreported issues if subsequent variables were variable variables. #316
  • πŸ› The NewKeywords sniff would throw a false positive for the const keyword when encountered in an interface. #312
  • πŸ› The NewNullableTypes sniff would not report on nullable return types for namespaced classnames used as a type hint. #323
  • πŸ› The PregReplaceEModifier sniff 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 e modifier when an array of regexes was passed. #300
  • πŸ› The PregReplaceEModifier sniff 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

Credits

Thanks go out to Juliette Reinders Folmer for her contributions to this version. πŸ‘