PHPCompatibility v7.1.4 Release Notes

Release Date: 2017-05-06 // about 7 years ago
  • โž• Added

    • ๐Ÿฑ ๐ŸŒŸ New CaseSensitiveKeywords sniff to detect use of non-lowercase self, static and parent keywords which could cause compatibility issues pre-PHP 5.5. #382
    • ๐Ÿฑ ๐ŸŒŸ New ConstantArraysUsingConst sniff to detect constants defined using the const keyword being assigned an array value which was not supported prior to PHP 5.6. #397
    • ๐Ÿฑ ๐ŸŒŸ New ForbiddenClosureUseVariableNames sniff to detect PHP 7.1 forbidden variable names in closure use statements. #386. Fixes #374
    • ๐Ÿฑ ๐ŸŒŸ New NewArrayStringDereferencing sniff to detect array and string literal dereferencing as introduced in PHP 5.5. #388
    • ๐Ÿฑ ๐ŸŒŸ New NewHeredocInitialize sniff to detect initialization of static variables and class properties/constants using the heredoc syntax which is supported since PHP 5.3. #391. Fixes #51
    • ๐Ÿฑ ๐ŸŒŸ New NewMagicClassConstant sniff to detect use of the magic ::class constant as introduced in PHP 5.5. #403. Fixes #364.
    • ๐Ÿฑ ๐ŸŒŸ New NewUseConstFunction sniff to detect use statements importing constants and functions as introduced in PHP 5.6. #401
    • ๐Ÿฑ โญ๏ธ DeprecatedFunctions sniff: recognize PHP 7.2 deprecated GD functions. #392
    • ๐Ÿฑ โญ๏ธ DeprecatedIniDirectives sniff: recognize PHP 7.2 deprecated mbstring.func_overload directive. #377
    • ๐Ÿฑ โญ๏ธ NewClasses sniff: check for the PHP 5.1 libXMLError class. #412
    • ๐Ÿฑ โญ๏ธ NewClasses sniff: recognize all native PHP Exception classes. #418
    • ๐Ÿฑ โญ๏ธ NewClosures sniff: check for closures being declared as static and closures using $this. Both of which was not supported pre-PHP 5.4. #389. Fixes #24.
    • โญ๏ธ NewFunctionParameters sniff: recognize new exclude_disabled parameter for the get_defined_functions() function as introduced in PHP 7.0.15. #375
    • ๐Ÿฑ โญ๏ธ NewFunctions sniff: recognize new PHP 7.2 socket related functions. #376
    • ๐Ÿฑ โญ๏ธ NewInterfaces sniff: check for some more PHP native interfaces. #411
    • ๐Ÿฑ โญ๏ธ New isClassProperty(), isClassConstant() and validDirectScope() utility methods to the PHPCompatibility_Sniff class. #393, #391.
    • ๐Ÿฑ โญ๏ธ New getTypeHintsFromFunctionDeclaration() utility method to the PHPCompatibility_Sniff class. #414.
    • ๐Ÿฑ โ˜”๏ธ Unit tests against false positives for the NewMagicMethods sniff. #381
    • ๐Ÿฑ โ˜”๏ธ More unit tests for the getTestVersion() utility method. #405, #430
    • ๐Ÿ’… ๐Ÿ’š The XML of the ruleset will now be validated and checked for consistent code style during the build testing by Travis. #433
    • ๐Ÿฑ ๐Ÿ“š Readme: information about setting installed_paths via a custom ruleset. #407
    • ๐Ÿš€ ๐Ÿ“š Changelog.md file containing a record of notable changes since the first tagged release. #421

    ๐Ÿ”„ Changed

    • ๐Ÿฑ ๐Ÿ“Œ The ForbiddenNamesAsDeclared sniff will now emit warnings for soft reserved keywords. #406, #370.
    • ๐Ÿฑ ๐Ÿ“Œ The ForbiddenNames sniff will now allow for the more liberal rules for usage of reserved keywords as of PHP 7.0. #417
    • ๐Ÿ‘• ๐Ÿ“Œ The InternalInterfaces, NewClasses, NewConstVisibility, NewInterfaces, NewMagicMethods, NonStaticMagicMethods and RemovedGlobalVariables sniffs will now also sniff for and correctly report violations in combination with anonymous classes. #378, #383, #393, #394, #395, #396. Fixes #351 and #333.
    • ๐Ÿฑ ๐Ÿ“Œ The NewClasses and NewInterfaces sniffs will now also report on new classes/interfaces when used as type hints. #414, #416. Fixes #352
    • ๐Ÿฑ ๐Ÿ“Œ The NewClasses sniff will now also report on Exception classes when used in (multi-)catch statements. #418. Fixes #373.
    • ๐Ÿฑ ๐Ÿ“Œ The NewScalarTypeDeclarations sniff will now report on new type hints even when the type hint is nullable. #379
    • ๐Ÿ”€ The NewNowdoc sniff has been renamed to NewNowdocQuotedHeredoc and will now also check for double quoted heredoc identifiers as introduced in PHP 5.3. #390
    • ๐Ÿฑ โช The NewClasses sniff will now also report anonymous classes which extend a new sniff when used in combination with PHPCS 2.4.0-2.8.0. #432. Fixes #334.
    • ๐Ÿฑ โœ๏ธ NewFunctionParameter sniff: version number precision for two parameters. #384, #428
    • ๐Ÿฑ โ˜”๏ธ Skipping two unit tests for the ForbiddenClosureUseVariable sniff when run on PHPCS 2.5.1 as these cause an infinite loop due to an upstream bug. #408
    • ๐Ÿฑ โ˜”๏ธ Skipping unit tests involving traits in combination with PHP < 5.4 and PHPCS < 2.4.0 as traits are not recognized in those circumstances. #431
    • ๐ŸŽ โ™ป๏ธ Various (minor) refactoring for improved performance and sniff accuracy. #385, #387, #415, #423, #424
    • ๐Ÿฑ โ™ป๏ธ Minor simplification of the PHPUnit 6 compatibility layer and other test code. #426, #425
    • General housekeeping. #398, #400
    • ๐Ÿ— ๐Ÿ”ง Minor tweaks to the Travis build script. #409
    • ๐Ÿฑ ๐Ÿ’š The sniffs are now also tested against PHP nightly for consistent results. #380

    ๐Ÿ›  Fixed

    • ๐Ÿฑ ๐Ÿ”ฅ Using unbounded ranges in testVersion resulted in unreported errors when used with sniffs using the supportsBelow() method. This affected the results of approximately half the sniffs. #430
    • ๐Ÿฑ ๐Ÿ› The ForbiddenNames sniff would throw false positives for use statements with the final modifier in traits. #402.
    • ๐Ÿฑ ๐Ÿ› The ForbiddenNames sniff would fail to report on functions declared to return by reference using a reserved keyword as the function name. #413
    • ๐Ÿฑ ๐Ÿ› The ForbiddenNames sniff would only examine the first part of a namespace and not report on reserved keywords used in subsequent parts of a nested namespace. #419
    • ๐Ÿฑ ๐Ÿ› The ForbiddenNames sniff would not always correctly report on use statements importing constants or functions using reserved keywords. #420
    • ๐Ÿฑ ๐Ÿ› The NewKeywords sniff would sometimes fail to report on the const keyword when used in a class, but not for a class constant. #424
    • ๐Ÿš€ ๐Ÿ’š PHPCS has released version 3.0 and updated the master branch to reflect this. This was causing the builds to fail. #422

    Credits

    ๐Ÿฑ Thanks go out to Juliette Reinders Folmer and Mark Clements for their contributions to this version. ๐Ÿ‘