Skip to content

PHPCompatibility 9.2.0

Compare
Choose a tag to compare
@jrfnl jrfnl released this 27 Jun 20:47
· 220 commits to master since this release
3db1bf1

See all related issues and PRs in the 9.2.0 milestone.

To keep informed of the progress of covering "everything PHP 7.4" in PHPCompatibility, please subscribe to issue #808.

Added

  • 🌟 New PHPCompatibility.Classes.ForbiddenAbstractPrivateMethods sniff to detect methods declared as both private as well as abstract. This was allowed between PHP 5.0.0 and 5.0.4, but disallowed in PHP 5.1 as the behaviour of private and abstract are mutually exclusive. #822
  • 🌟 New PHPCompatibility.Classes.NewTypedProperties sniff to detect PHP 7.4 typed property declarations. #801, #829
  • 🌟 New PHPCompatibility.Classes.RemovedOrphanedParent sniff to detect the use of the parent keyword in classes without a parent (non-extended classes). This code pattern is deprecated in PHP 7.4 and will become a compile-error in PHP 8.0. #818
  • 🌟 New PHPCompatibility.FunctionDeclarations.NewExceptionsFromToString sniff to detect throwing exceptions from __toString() methods. This would previously result in a fatal error, but will be allowed as of PHP 7.4. #814
  • 🌟 New PHPCompatibility.FunctionDeclarations.ForbiddenToStringParameters sniff to detect __toString() function declarations expecting parameters. This was disallowed in PHP 5.3. #815
  • 🌟 New PHPCompatibility.MethodUse.ForbiddenToStringParameters sniff to detect direct calls to __toString() magic methods passing parameters. This was disallowed in PHP 5.3. #830
  • 🌟 New PHPCompatibility.Operators.ChangedConcatOperatorPrecedence sniff to detect code affected by the upcoming change in operator precedence for the concatenation operator. The concatenation operator precedence will be lowered in PHP 8.0, with deprecation notices for code affected being thrown in PHP 7.4. #805
  • 🌟 New PHPCompatibility.Operators.RemovedTernaryAssociativity sniff to detect code relying on left-associativity of the ternary operator. This behaviour will be deprecated in PHP 7.4 and removed in PHP 8.0. #810
  • 🌟 New PHPCompatibility.Syntax.NewArrayUnpacking sniff to detect the use of the spread operator to unpack arrays when declaring a new array, as introduced in PHP 7.4. #804
  • ⭐ PHPCompatibility.Classes.NewClasses sniff: recognize the new ReflectionReference class as introduced in PHP 7.4. #820
  • ⭐ PHPCompatibility.Constants.NewConstants sniff: detection of the new PHP 7.4 Core (Standard), MBString, Socket and Tidy constants. #821
  • ⭐ PHPCompatibility.FunctionUse.NewFunctions sniff: detect usage of the new PHP 7.4 get_mangled_object_vars(), mb_str_split(), openssl_x509_verify(), password_algos(), pcntl_unshare(), sapi_windows_set_ctrl_handler() and sapi_windows_generate_ctrl_event() functions. #811, #819, #827
  • ⭐ PHPCompatibility.FunctionUse.NewFunctions sniff: recognize the new OCI functions as introduced in PHP 7.2.14 and PHP 7.3.1. #786
  • ⭐ PHPCompatibility.FunctionUse.RemovedFunctions sniff: recognize the PHP 7.4 deprecated ldap_control_paged_result_response() and ldap_control_paged_result() functions. #831
  • ⭐ PHPCompatibility.FunctionUse.RemovedFunctions sniff: recognize the Payflow Pro/pfpro functions as removed in PHP 5.1. #823
  • ⭐ PHPCompatibility.FunctionUse.RequiredToOptionalFunctionParameters sniff: account for the parameters for array_merge() and array_merge_recursive() becoming optional in PHP 7.4. #817
  • ⭐ PHPCompatibility.IniDirectives.RemovedIniDirectives sniff: recognize the Payflow Pro/pfpro ini directives as removed in PHP 5.1. #823
  • ⭐ Recognize the interbase/Firebird extension functionality which will be removed in PHP 7.4 (moved to PECL) in the RemovedConstants, RemovedExtensions, RemovedFunctions and RemovedIniDirectives sniffs. #807
  • ⭐ Recognize the wddx extension functionality which will be removed in PHP 7.4 (moved to PECL) in the RemovedExtensions and RemovedFunctions sniffs. #826
  • ⭐ New isShortTernary() and isUnaryPlusMinus() utility methods to the PHPCompatibility\Sniff class. #810, #805

Changed

  • ✏️ The PHPCompatibility.Extensions.RemovedExtensions sniff will now only report on the removed Payflow Pro extension when a function uses pfpro_ as a prefix. Previously, it used the pfpro prefix (without underscore) for detection. #812
  • ✏️ The error message thrown when the T_ELLIPSIS token, i.e. the spread operator, is detected. #803
    PHP 7.4 adds a third use-case for the spread operator. The adjusted error message accounts for this.
  • β˜” PHPCompatibility.FunctionDeclarations.NewParamTypeDeclarations is now also tested with parameters using the splat operator. #802
  • πŸ“š The documentation now uses the GitHub repo of PHP_CodeSniffer as the canonical entry point for PHP_CodeSniffer. Previously, it would point to the PEAR package. #788
  • πŸ“š The links in the changelog now all point to the PHPCompatibility/PHPCompatibility repo and no longer to the (deprecated) wimg/PHPCompatibility repo. #828
  • ♻️ Various minor inline documentation improvements. #825
  • πŸ”§ Various performance optimizations and code simplifications. #783, #784, #795, #813
  • πŸ’š Travis: build tests are now being run against PHP 7.4 (unstable) as well. #790
    Note: the builds are currently not (yet) tested against PHP 8.0 (unstable) as there is no compatible PHPUnit version available (yet).
  • πŸ”§ Travis: The build script has been refactored to use stages to get the most relevant results faster. Additionally some more tweaks have been made to improve and/or simplify the build script. #798
  • πŸ”§ Build/PHPCS: warnings are no longer allowed for the PHPCompatibility native code. #800
  • πŸ”§ Build/PHPCS: added variable assignment alignment check and file include check to the PHPCompatibility native CS configuration. #824
  • πŸ”§ The minimum version for the recommended DealerDirect/phpcodesniffer-composer-installer Composer plugin has been upped to 0.5.0. #791

Fixed

  • πŸ› The PHPCompatibility.Extensions.RemovedExtensions sniff contained a typo in the alternative recommended for the removed mcve extension. #806
  • πŸ› The PHPCompatibility.Extensions.RemovedExtensions sniff listed the wrong removal version number for the Payflow Pro/pfpro extension (PHP 5.3 instead of the correct 5.1). #823

Credits

Thanks go out to YΔ±lmaz and Tim Millwood for their contribution to this version. πŸ‘