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 bothprivate
as well asabstract
. This was allowed between PHP 5.0.0 and 5.0.4, but disallowed in PHP 5.1 as the behaviour ofprivate
andabstract
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 theparent
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 newReflectionReference
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.4get_mangled_object_vars()
,mb_str_split()
,openssl_x509_verify()
,password_algos()
,pcntl_unshare()
,sapi_windows_set_ctrl_handler()
andsapi_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 deprecatedldap_control_paged_result_response()
andldap_control_paged_result()
functions. #831 - ๐ฑ โญ๏ธ
PHPCompatibility.FunctionUse.RemovedFunctions
sniff: recognize thePayflow Pro/pfpro
functions as removed in PHP 5.1. #823 - ๐ โญ๏ธ
PHPCompatibility.FunctionUse.RequiredToOptionalFunctionParameters
sniff: account for the parameters forarray_merge()
andarray_merge_recursive()
becoming optional in PHP 7.4. #817 - ๐ฑ โญ๏ธ
PHPCompatibility.IniDirectives.RemovedIniDirectives
sniff: recognize thePayflow 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 theRemovedConstants
,RemovedExtensions
,RemovedFunctions
andRemovedIniDirectives
sniffs. #807 - ๐ฑ โญ๏ธ Recognize the
wddx
extension functionality which will be removed in PHP 7.4 (moved to PECL) in theRemovedExtensions
andRemovedFunctions
sniffs. #826 - ๐ฑ โญ๏ธ New
isShortTernary()
andisUnaryPlusMinus()
utility methods to thePHPCompatibility\Sniff
class. #810, #805
๐ Changed
- ๐ฑ โ๏ธ The
PHPCompatibility.Extensions.RemovedExtensions
sniff will now only report on the removedPayflow Pro
extension when a function usespfpro_
as a prefix. Previously, it used thepfpro
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 forPHP_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 to0.5.0
. #791
๐ Fixed
- ๐ฑ ๐ The
PHPCompatibility.Extensions.RemovedExtensions
sniff contained a typo in the alternative recommended for the removedmcve
extension. #806 - ๐ฑ ๐ The
PHPCompatibility.Extensions.RemovedExtensions
sniff listed the wrong removal version number for thePayflow 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. ๐
- ๐ฑ ๐ New