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 byfunc_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 newimap.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 thePHPCompatibility\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 returnfalse
when no valid direct scope has been found, but it will now return thestackPtr
to the scope token if a valid direct scope was encountered. #758 - โช
NewOperators
: updated the version number forT_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. ๐
- ๐ New