PHPCompatibility v9.1.0 Release Notes

Release Date: 2018-12-16 // over 5 years ago
  • ๐Ÿ‘€ See all related issues and PRs in the 9.1.0 milestone.

    โž• Added

    • ๐ŸŒŸ New PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue sniff to detect code which could be affected by the PHP 7.0 change in the values reported by func_get_arg(), func_get_args(), debug_backtrace() and exception backtraces. #750. Fixes #585.
    • ๐Ÿฑ ๐ŸŒŸ New PHPCompatibility.MethodUse.NewDirectCallsToClone sniff to detect direct call to a __clone() magic method which wasn't allowed prior to PHP 7.0. #743. Fixes #629.
    • ๐Ÿฑ ๐ŸŒŸ New PHPCompatibility.Variables.ForbiddenThisUseContext sniff to detect most of the inconsistencies surrounding the use of the $this variable, which were removed in PHP 7.1. #762, #771. Fixes #262 and #740.
    • ๐Ÿฑ โญ๏ธ NewClasses: detection of more native PHP Exceptions. #743, #753
    • ๐Ÿฑ โญ๏ธ NewConstants : detection of the new PHP 7.3 Curl, Stream Crypto and LDAP constants and some more PHP 7.0 Tokenizer constants. #752, #767, #778
    • ๐Ÿฑ โญ๏ธ NewFunctions sniff: recognize (more) new LDAP functions as introduced in PHP 7.3. #768
    • ๐Ÿฑ โญ๏ธ NewFunctionParameters sniff: recognize the new $serverctrls parameter which was added to a number of LDAP functions in PHP 7.3. #769
    • โญ๏ธ NewIniDirectives sniff: recognize the new imap.enable_insecure_rsh ini directive as introduced in PHP 7.1.25, 7.2.13 and 7.3.0. #770
    • ๐Ÿฑ โญ๏ธ NewInterfaces sniff: recognize two more Session related interfaces which were introduced in PHP 5.5.1 and 7.0 respectively. #748
    • ๐Ÿฑ โญ๏ธ Duplicate of upstream findStartOfStatement() method to the PHPCompatibility\PHPCSHelper class to allow for PHPCS cross-version usage of that method. #750

    ๐Ÿ”„ Changed

    • ๐Ÿ’… ๐Ÿ“Œ RemovedPHP4StyleConstructors: will now also detect PHP4-style constructors when declared in interfaces. #751
    • ๐Ÿ“Œ Sniff::validDirectScope(): the return value of this method has changed. Previously it would always be a boolean. It will stil return false when no valid direct scope has been found, but it will now return the stackPtr to the scope token if a valid direct scope was encountered. #758
    • โช NewOperators : updated the version number for T_COALESCE_EQUAL. #746
    • ๐Ÿฑ ๐Ÿ“ Minor improvement to an error message in the unit test suite. #742
    • ๐Ÿฑ โ™ป๏ธ Various code clean-up and improvements. #745, #756, #774
    • ๐Ÿ“š โ™ป๏ธ Various minor inline documentation fixes. #749, #757
    • ๐Ÿฑ โ˜”๏ธ Improved code coverage recording. #744, #776
    • ๐Ÿ— ๐Ÿ’š Travis: build tests are now being run against PHP 7.3 as well. #511
      Note: full PHP 7.3 support is only available in combination with PHP_CodeSniffer 2.9.2 or 3.3.1+ due to an incompatibility within PHP_CodeSniffer itself.

    ๐Ÿ›  Fixed

    • โœ… Compatibility with the upcoming release of PHPCS 3.4.0. Deal with changed behaviour of the PHPCS Tokenizer regarding binary type casts. #760
    • ๐Ÿ‘• ๐Ÿ› InternalInterfaces: false negative for implemented/extended interfaces prefixed with a namespace separator. #775
    • ๐Ÿฑ ๐Ÿ› NewClasses: the introduction version of various native PHP Exceptions has been corrected. #743, #753
    • ๐Ÿฑ ๐Ÿ› NewInterfaces: false negative for implemented/extended interfaces prefixed with a namespace separator. #775
    • ๐Ÿ’… ๐Ÿ› RemovedPHP4StyleConstructors: the sniff would examine methods in nested anonymous classes as if they were methods of the higher level class. #751
    • ๐Ÿ’… โช RemovedPHP4StyleConstructors: the sniff will no longer throw false positives for the first method in an anonymous class when used in combination with PHPCS 2.3.x. #751
    • ๐Ÿฑ โช ReservedFunctionNames: fixed incorrect error message text for methods in anonymous classes when used in combination with PHPCS 2.3.x. #755
    • ๐Ÿฑ ๐Ÿ› ReservedFunctionNames: prevent duplicate errors being thrown for methods in nested anonymous classes. #755
    • ๐Ÿฑ ๐Ÿ› PHPCSHelper::findEndOfStatement(): minor bug fix. #749
    • ๐Ÿฑ ๐Ÿ› Sniff::isClassProperty(): class properties for classes nested in conditions or function calls were not always recognized as class properties. #758

    Credits

    ๐Ÿฑ Thanks go out to Jonathan Champ for his contribution to this version. ๐Ÿ‘