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 usingdefine()
being assigned anarray
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 madeglobal
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 thestrstr()
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.5finally
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 theconst
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 removedereg
,mssql
,mysql
andsybase_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 anwarning
. Now it will throw anerror
when a removed ini directive is used. #110. - โ
:pushpin: The
DeprecatedNewReference
sniff will now throw an error when thetestVersion
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 thetestVersion
includes PHP 7.0 or higher. #110 - ๐ :pencil2:
NewKeywords
sniff: clarified the error message text for theuse
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 throwingUndefined index
notices when used in combination with PHPCS 2.2.0. #100. Fixes #42. - ๐ :bug: The
ForbiddenNamesAsInvokedFunctions
sniff would incorrectly throw an error if thethrow
keyword was used with parenthesis. Fixes #118. - :bug: The
PregReplaceEModifier
sniff incorrectly identifiede
's in the pattern as thee
modifier when using{}
bracket delimiters for the regex. #94 - ๐ :bug: The
RemovedExtensions
sniff was throwing anerror
instead of awarning
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:
- โ
:zap: Ability to specify a range of PHP versions against which to test your code base for compatibility, i.e.