github PHPCompatibility/PHPCompatibility 7.0.7
7.0.7: PHP 7.0 Sniffs - update 2016-10-20

latest releases: 9.3.5, 9.3.4, 9.3.3...
7 years ago

PHP 7.0 Sniffs - update 2016-10-20

See all related issues and PRs in the 7.0.7 milestone.

Added

  • 🌟 New ForbiddenBreakContinueOutsideLoop sniff: verify that break/continue is not used outside of a loop structure. This will cause fatal errors since PHP 7.0. #278. Fixes #275
  • 🌟 New NewConstVisibility sniff: detect visibility indicators for class and interface constants as introduced in PHP 7.1. #280. Fixes #249
  • 🌟 New NewHashAlgorithms sniff to check used hash algorithms against the PHP version in which they were introduced. #242
  • 🌟 New NewMultiCatch sniff: detect catch statements catching multiple Exceptions as introduced in PHP 7.1. #281. Fixes #251
  • 🌟 New NewNullableTypes sniff: detect nullable parameter and return type hints (only supported in PHPCS >= 2.3.4) as introduced in PHP 7.1. #282. Fixes #247
  • DeprecatedIniDirectives sniff: recognize PHP 7.1 removed session ini directives. #256
  • NewFunctions sniff: recognize new socket_export_stream() function as introduced in PHP 7.0.7. #264
  • NewFunctions sniff: recognize new curl_...(), is_iterable(), pcntl_async_signals(), session_create_id(), session_gc() functions as introduced in PHP 7.1. #273
  • NewFunctionParameters sniff: recognize new OpenSSL function parameters as introduced in PHP 7.1. #258
  • NewIniDirectives sniff: recognize new session ini directives as introduced in PHP 7.1. #259
  • NewScalarReturnTypeDeclarations sniff: recognize PHP 7.1 void return type hint. #250
  • NewScalarTypeDeclarations sniff: recognize PHP 7.1 iterable type hint. #255
  • ⭐ Recognize the PHP 7.1 deprecated mcrypt functionality in the RemovedExtensions, DeprecatedFunctions and DeprecatedIniDirectives sniffs. #257

Changed

  • 📌 LongArrays sniff used to only throw warnings. It will now throw errors for PHP versions in which the long superglobals have been removed. #270
  • 📌 The NewIniDirectives sniff used to always throw an warning. Now it will throw an error when a new ini directive is used in combination with ini_set(). #246.
  • 📌 RemovedHashAlgorithms sniff: also recognize removed algorithms when used with the PHP 5.5+ hash_pbkdf2() function. #240
  • 📌 Properly recognize nullable type hints in the getMethodParameters() utility method. #282
  • ✏️ DeprecatedPHP4StyleConstructors sniff: minor error message text fix. #236
  • ✏️ NewIniDirectives sniff: improved precision for the introduction version numbers being reported. #246
  • ♻️ Various (minor) refactoring for improved performance and sniff accuracy. #238, #244, #240, #276
  • ☔ Re-activate the unit tests for the NewScalarReturnTypeDeclarations sniff. #250

Fixed

  • 🐛 The DeprecatedPHP4StyleConstructors sniff would not report errors when the case of the class name and the PHP4 constructor function name did not match. #236
  • 🐛 LongArrays sniff would report false positives for class properties shadowing removed PHP superglobals. #270. Fixes #268.
  • 🐛 The NewClasses sniff would not report errors when the case of the class name used and "official" class name did not match. #237
  • 🐛 The NewIniDirectives sniff would report violations against the PHP version in which the ini directive was introduced. This should be the version below it. #246
  • 🐛 PregReplaceEModifier sniff would report false positives for compound regex parameters with different quote types. #266. Fixes #265.
  • 🐛 RemovedGlobalVariables sniff would report false positives for lowercase/mixed cased variables shadowing superglobals. #245.
  • 🐛 The RemovedHashAlgorithms sniff would not report errors when the case of the hash function name used and "official" class name did not match. #240
  • 🐛 The ShortArray sniff would report all violations on the line of the PHP open tag, not on the lines of the short array open/close tags. #238

Credits

Thanks go out to Juliette Reinders Folmer for her contributions to this version. 👏

Don't miss a new PHPCompatibility release

NewReleases is sending notifications on new releases.