PHPCompatibility v9.2.0 Release Notes

Release Date: 2019-06-27 // almost 5 years ago
  • ๐Ÿ‘€ 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. ๐Ÿ‘