PHPCompatibility v7.0 Release Notes

Release Date: 2016-07-02 // almost 8 years ago
  • ๐Ÿ‘€ See all related issues and PRs in the [7.0 milestone].

    โž• Added

    • โœ… :zap: Ability to specify a range of PHP versions against which to test your code base for compatibility, i.e. --runtime-set testVersion 5.0-5.4 will now test your code for compatibility with PHP 5.0 up to PHP 5.4. #99
    • ๐Ÿ›  :star2: New NewFunctionArrayDereferencing sniff to detect function array dereferencing as introduced in PHP 5.4. Fixes #52.
    • ๐Ÿ›  :star2: New ShortArray sniff to detect short array syntax as introduced in PHP 5.4. #97. Fixes #47.
    • ๐Ÿ›  :star2: New TernaryOperators sniff to detect ternaries without the middle part (elvis operator) as introduced in PHP 5.3. #101, #103. Fixes #49.
    • :star2: New ConstantArraysUsingDefine sniff to detect constants declared using define() being assigned an array value which was not allowed prior to PHP 7.0. #110
    • ๐Ÿ’… :star2: New DeprecatedPHP4StyleConstructors sniff to detect PHP 4 style class constructor methods which are deprecated as of PHP 7. #109.
    • ๐Ÿšš :star2: New ForbiddenEmptyListAssignment sniff to detect empty list() assignments which have been removed in PHP 7.0. #110
    • :star2: New ForbiddenFunctionParametersWithSameName sniff to detect functions declared with multiple same-named parameters which is no longer accepted since PHP 7.0. #110
    • :star2: New ForbiddenGlobalVariableVariable sniff to detect variable variables being made global which is not allowed since PHP 7.0. #110
    • :star2: New ForbiddenNegativeBitshift sniff to detect bitwise shifts by negative number which will throw an ArithmeticError in PHP 7.0. #110
    • 0๏ธโƒฃ :star2: New ForbiddenSwitchWithMultipleDefaultBlocks sniff to detect switch statements with multiple default blocks which is not allowed since PHP 7.0. #110
    • :star2: New NewAnonymousClasses sniff to detect anonymous classes as introduced in PHP 7.0. #110
    • ๐Ÿ›  :star2: New NewClosure sniff to detect anonymous functions as introduced in PHP 5.3. Fixes #35
    • ๐Ÿ— :star2: New NewFunctionParameters sniff to detect use of new parameters in build-in PHP functions. Initially only sniffing for the new PHP 7.0 function parameters and the new PHP 5.3+ before_needle parameter for the strstr() function. #110, #112. Fixes #27.
    • :star2: New NewGroupUseDeclarations sniff to detect group use declarations as introduced in PHP 7.0. #110
    • :star2: New NewScalarReturnTypeDeclarations sniff to detect scalar return type hints as introduced in PHP 7.0. #110
    • :star2: New NewScalarTypeDeclarations sniff to detect scalar function parameter type hints as introduced in PHP 7.0. #110
    • ๐Ÿ— :star2: New RemovedFunctionParameters sniff to detect use of removed parameters in build-in PHP functions. Initially only sniffing for the function parameters removed in PHP 7.0. #110
    • :star2: New RemovedGlobalVariables sniff to detect the PHP 7.0 removed $HTTP_RAW_POST_DATA superglobal. #110
    • ๐Ÿ—„ :star: DeprecatedFunctions sniff: detection of the PHP 5.4 deprecated OCI8 functions. #93
    • :star: ForbiddenNamesAsInvokedFunctions sniff: recognize PHP 5.5 finally as a reserved keywords when invoked as a function. #110
    • :star: NewKeywords sniff: detection of the use of the PHP 5.1+ __halt_compiler keyword. Fixes #50.
    • ๐Ÿ›  :star: NewKeywords sniff: detection of the PHP 5.3+ nowdoc syntax. Fixes #48.
    • ๐Ÿ›  :star: NewKeywords sniff: detection of the use of the const keyword outside of a class for PHP < 5.3. Fixes #50.
    • ๐Ÿšš :star: DeprecatedFunctions sniff: recognize PHP 7.0 deprecated and removed functions. #110
    • ๐Ÿšš :star: DeprecatedIniDirectives sniff: recognize PHP 7.0 removed ini directives. #110
    • :star: ForbiddenNamesAsInvokedFunctions sniff: recognize new PHP 7.0 reserved keywords when invoked as functions. #110
    • :star: ForbiddenNames sniff: recognize new PHP 7.0 reserved keywords. #110
    • :star: NewFunctions sniff: recognize new functions as introduced in PHP 7.0. #110
    • :star: NewLanguageConstructs sniff: recognize new PHP 7.0 <=> "spaceship" and ?? null coalescing operators. #110
    • ๐Ÿšš :star: RemovedExtensions sniff: recognize PHP 7.0 removed ereg, mssql, mysql and sybase_ct extensions. #110
    • โœ… :umbrella: Additional unit tests for the NewLanguageConstructs sniff. #110
    • โœ… :books: Readme: New section containing information about the use of the testVersion config variable.
    • :books: Readme: Sponsor credits.

    ๐Ÿ”„ Changed

    • ๐Ÿšš :pushpin: The DeprecatedIniDirectives sniff used to always throw an warning. Now it will throw an error when a removed ini directive is used. #110.
    • โœ… :pushpin: The DeprecatedNewReference sniff will now throw an error when the testVersion includes PHP 7.0 or higher. #110
    • ๐Ÿ‘ :pushpin: The ForbiddenNames sniff now supports detection of reserved keywords when used in combination with PHP 7 anonymous classes. #108, #110.
    • โœ… :pushpin: The PregReplaceEModifier sniff will now throw an error when the testVersion includes PHP 7.0 or higher. #110
    • ๐Ÿ›  :pencil2: NewKeywords sniff: clarified the error message text for the use keyword. Fixes #46.
    • ๐Ÿ”จ :recycle: Minor refactor of the testVersion related utility functions. #98
    • ๐Ÿ›  :wrench: Add autoload to the composer.json file. #96 Fixes #67.
    • โšก๏ธ :wrench: Minor other updates to the composer.json file. #75
    • :wrench: Improved creation of the code coverage reports needed by coveralls via Travis.
    • โœ… :green_heart: The sniffs are now also tested against PHP 7.0 for consistent results.

    ๐Ÿ›  Fixed

    • ๐Ÿ›  :bug: The ForbiddenCallTimePassByReference sniff was throwing Undefined index notices when used in combination with PHPCS 2.2.0. #100. Fixes #42.
    • ๐Ÿ›  :bug: The ForbiddenNamesAsInvokedFunctions sniff would incorrectly throw an error if the throw keyword was used with parenthesis. Fixes #118.
    • :bug: The PregReplaceEModifier sniff incorrectly identified e's in the pattern as the e modifier when using {} bracket delimiters for the regex. #94
    • ๐Ÿšš :bug: The RemovedExtensions sniff was throwing an error instead of a warning for deprecated, but not (yet) removed extensions. Fixes #62.

    Credits

    Thanks go out to AlexMiroshnikov, [Chris Abernethy], [dgudgeon], [djaenecke], [Eugene Maslovich], [Ken Guest], Koen Eelen, [Komarov Alexey], [Mark Clements] and [Remko van Bezooijen] for their contributions to this version. :clap: