packagist phpcompatibility/php-compatibility 7.0.5
7.0.5: PHP 7.0 Sniffs - update 2016-09-08

latest releases: dev-develop, dev-feature/readme-fix-more-broken-badges, dev-WIP/feature/207-509-582-removed-extension-recognition-precision...
9 years ago

PHP 7.0 Sniffs - update 2016-09-08

See all related issues and PRs in the 7.0.5 milestone.

Added

  • 🌟 New MbstringReplaceEModifier sniff to detect the use of the PHP 7.1 deprecated e modifier in Mbstring regex functions. #202
  • ⭐ The ForbiddenBreakContinueVariableArguments sniff will now also report on break 0/continue 0 which is not allowed since PHP 5.4. #209
  • ⭐ New getFunctionCallParameters(), getFunctionCallParameter() utility methods in the PHPCompatibility_Sniff base class. #170
  • ⭐ New tokenHasScope() utility method in the PHPCompatibility_Sniff base class. #189
  • ☔ Unit test for goto and callable detection and some other miscellanous extra unit tests for the NewKeywords sniff. #189
  • 📚 Readme: Information for sniff developers about running unit tests for other sniff libraries using the PHPCS native test framework without running into conflicts with the PHPCompatibility specific unit test framework. #217

Changed

  • 📌 The ForbiddenNames sniff will now also check interface declarations for usage of reserved keywords. #200
  • 📌 PregReplaceEModifier sniff: improved handling of regexes build up of a combination of variables, function calls and/or text strings. #201
  • ⏪ The NewKeywords sniff will now also correctly recognize new keywords when used in combination with older PHPCS versions and/or run on older PHP versions. #189
  • ✏️ PregReplaceEModifier sniff: minor improvement to the error message text. #201
  • ♻️ Various (minor) refactoring for improved performance and sniff accuracy. #170, #188, #189, #199, #200, #201, #208
  • 🔧 The unit tests for the utility methods have been moved to their own subdirectory within Tests. #215
  • 💚 The sniffs are now also tested against PHP 7.1 for consistent results. #216

Removed

Fixed

  • 🐛 ConstantArraysUsingDefine sniff: the version check logic was reversed causing the error not to be reported in certain circumstances. #199
  • 🐛 The DeprecatedIniDirectives and NewIniDirectives sniffs could potentially trigger on the ini value instead of the ini directive name. #170
  • 🐛 ForbiddenNames sniff: Reserved keywords when used as the name of a constant declared using define() would always be reported independently of the testVersion set. #200
  • 🐛 PregReplaceEModifier sniff would not report errors when the function name used was not in lowercase. #201
  • 🐛 TernaryOperators sniff: the version check logic was reversed causing the error not to be reported in certain circumstances. #188
  • 🐛 The getFQClassNameFromNewToken() and getFQClassNameFromDoubleColonToken() utility methods would get confused when the class name was a variable instead of being hard-coded, resulting in a PHP warning being thown. #206. Fixes #205.
  • 🐛 The getFunctionCallParameters() utility method would incorrectly identify an extra parameter if the last parameter passed to a function would have an - unnecessary - comma after it. The getFunctionCallParameters() utility method also did not handle parameters passed as short arrays correctly. #213. Fixes #211.
  • ☔ Unit tests for the NewFunctionArrayDereferencing sniff were not being run due to a naming error. #208
  • 📚 Readme: Information about setting the testVersion from a custom ruleset was incorrect. #204
  • 🔧 Path to PHPCS in the unit tests breaking for non-Composer installs. #198

Credits

Thanks go out to Juliette Reinders Folmer and Yoshiaki Yoshida for their contributions to this version. 👏

Don't miss a new php-compatibility release

NewReleases is sending notifications on new releases.