Releases: PHPCompatibility/PHPCompatibility
PHPCompatibility 9.3.5
See all related issues and PRs in the 9.3.5 milestone.
Added
- ⭐
PHPCompatibility.Classes.NewClasses
sniff: recognize the newFFI
extension related classes as introduced in PHP 7.4. #949 - ⭐
PHPCompatibility.IniDirectives.NewIniDirectives
sniff: detect use of the newFFI
extension related ini directives as introduced in PHP 7.4. #949
Changed
- 📝
PHPCompatibility.Syntax.NewShortArray
: improved clarity of the error message and made it consistent with other error messages in this standard. #934 - 📝
PHPCompatibility.Interfaces.NewInterfaces
: updated the URL which is mentioned in select error messages. #942 - ♻️ Another slew of code documentation fixes. #937, #939, #940, #941, #943, #944, #951, #950. Fixes #734.
- 💚 Travis: various tweaks. The builds against PHP 7.4 are no longer allowed to fail. #935, #938
For running the sniffs on PHP 7.4, it is recommended to use PHP_CodeSniffer 3.5.0+ as PHP_CodeSniffer itself is not compatible with PHP 7.4 until version 3.5.0.
Fixed
- 🐛
PHPCompatibility.Classes.NewClasses
: two new PHP 7.4 classes were being checked as if they were Exceptions. #945
Credits
Thanks go out to William Entriken for their contribution to this version. 👏
PHPCompatibility 9.3.4
See all related issues and PRs in the 9.3.4 milestone.
Fixed
- 🐛
PHPCompatibility.Keywords.ForbiddenNames
: false positive forlist
when used in aforeach()
condition. #930. Fixes #928, #929
Credits
Thanks go out to Sergii Bondarenko for their contribution to this version. 👏
PHPCompatibility 9.3.3
See all related issues and PRs in the 9.3.3 milestone.
Added
- ⭐
PHPCompatibility.Constants.NewConstants
sniff: detection of yet more (undocumented) PHP 7.2 Sodium constants. #924 - ⭐
PHPCompatibility.Keywords.ForbiddenNames
sniff: detect the use of more reserved keywords which are not allowed to be used to name certain constructs. #923. Fixes #922
Fixed
- 🐛
PHPCompatibility.FunctionNameRestrictions.RemovedPHP4StyleConstructors
: false positive detecting PHP4-style constructors when declared in interfaces. The class implementing the interface will not have the same name as the interface, so the actual method would not be regarded as a PHP4 style constructor. #921
Credits
Thanks go out to Nikhil for their contribution to this version. 👏
PHPCompatibility 9.3.2
See all related issues and PRs in the 9.3.2 milestone.
Added
- ⭐
PHPCompatibility.Constants.NewConstants
sniff: detection of the PHP 7.2SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13
constant. #915 - 📚 Readme: a list of projects which are build upon or extend PHPCompatibility. #904
Changed
- 📌
PHPCompatibility.FunctionNameRestrictions.RemovedPHP4StyleConstructors
: minor efficiency fix to make the sniff faster. #912 - 📌
PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames
: functions marked as@deprecated
in the function docblock will now be ignored by this sniff. #917. Fixes #911 - 📝
PHPCompatibility.FunctionDeclarations.ForbiddenToStringParameters
: the$ooScopeTokens
property is nowprotected
, it should never have beenpublic
in the first place. #907 - ♻️ More code documentation fixes. #903, #916
- 📚 Readme/Contributing: various tweaks. #904, #905
Fixed
- 🐛
PHPCompatibility.FunctionUse.OptionalToRequiredFunctionParameters
: false positive when a class is instantiated which has the same name as one of the affected functions. #914. Fixes #913 - 🐛
PHPCompatibility.FunctionUse.RequiredToOptionalFunctionParameters
: false positive when a class is instantiated which has the same name as one of the affected functions. #914 - 🐛
PHPCompatibility.MethodUse.NewDirectCallsToClone
: false positive on calling__clone()
from within the class being cloned #910. Fixes #629 (comment) - 🐛
PHPCompatibility.Miscellaneous.ValidIntegers
: binary numbers using an uppercaseB
were not always recognized correctly. #909
PHPCompatibility 9.3.1
See all related issues and PRs in the 9.3.1 milestone.
Changed
- ♻️ A whole slew of code documentation fixes. #892, #895, #896, #897, #898, #899, #900
- 🔧 Travis: minor tweaks to the build script. #893
Fixed
- 🐛
PHPCompatibility.ParameterValues.RemovedImplodeFlexibleParamOrder
: false positive when an array item in the second parameter contained a ternary. #891. Fixes #890 - 🐛
PHPCompatibility.ParameterValues.RemovedImplodeFlexibleParamOrder
: will now take array casts into account when determining which parameter is$pieces
. #891. - 🐛
PHPCompatibility.ParameterValues.RemovedImplodeFlexibleParamOrder
: hardening of the logic to not examine the second parameter when the first is just and only a text string ($glue
). #891.
PHPCompatibility 9.3.0
See all related issues and PRs in the 9.3.0 milestone.
To keep informed of the progress of covering "everything PHP 7.4" in PHPCompatibility, please subscribe to issue #808.
Changes expected in PHPCompatibility 10.0.0
The next version of PHPCompatibility is expected to include a new external dependency.
In this same release, support for PHP < 5.4 and PHP_CodeSniffer < 2.6.0 will be dropped.
The 10.0.0
release is expected around the same time as the release of PHP 7.4 - end of November/beginning of December 2019.
Added
- 🌟 New
PHPCompatibility.Miscellaneous.NewPHPOpenTagEOF
sniff to detect a stand-alone PHP open tag at the end of a file, without trailing newline, as will be supported as of PHP 7.4. #843 - 🌟 New
PHPCompatibility.ParameterValues.ForbiddenStripTagsSelfClosingXHTML
sniff to detect calls tostrip_tags()
passing self-closing XHTML tags in the$allowable_tags
parameter. This has not been supported since PHP 5.3.4. #866 - 🌟 New
PHPCompatibility.ParameterValues.NewHTMLEntitiesEncodingDefault
sniff to detect calls tohtml_entity_decode()
,htmlentities()
andhtmlspecialchars()
which are impacted by the change to the default value of the$encoding
parameter in PHP 5.4. #862 - 🌟 New
PHPCompatibility.ParameterValues.NewIconvMbstringCharsetDefault
sniff to detect code impacted by the change in thedefault_charset
value in PHP 5.6. #864 Fixes #839 - 🌟 New
PHPCompatibility.ParameterValues.NewIDNVariantDefault
sniff to detect calls toidn_to_ascii()
andidn_to_utf8()
impacted by the PHP 7.4 change in the default value for the$variant
parameter. #861 - 🌟 New
PHPCompatibility.ParameterValues.NewPasswordAlgoConstantValues
sniff to detect calls topassword_hash()
andpassword_needs_rehash()
impacted by the changed value of thePASSWORD_DEFAULT
,PASSWORD_BCRYPT
,PASSWORD_ARGON2I
andPASSWORD_ARGON2ID
constants in PHP 7.4. #865 - 🌟 New
PHPCompatibility.ParameterValues.NewProcOpenCmdArray
sniff to detect calls toproc_open()
passing an array for the$cmd
parameter as supported as of PHP 7.4. #869 - 🌟 New
PHPCompatibility.ParameterValues.NewStripTagsAllowableTagsArray
sniff to detect calls tostrip_tags()
passing an array for the$allowable_tags
parameter as will be supported as of PHP 7.4. #867 - 🌟 New
PHPCompatibility.ParameterValues.RemovedImplodeFlexibleParamOrder
sniff to detectimplode()
being called with$glue
and$pieces
in reverse order from the documented argument order. This was previously allowed for historical reasons, but will be deprecated in PHP 7.4. #846 - 🌟 New
PHPCompatibility.ParameterValues.RemovedMbStrrposEncodingThirdParam
sniff to detect the$encoding
being passed as the third, instead of the fourth parameter, tomb_strrpos()
as has been soft deprecated since PHP 5.2 and will be hard deprecated as of PHP 7.4. #860 - 🌟 New
PHPCompatibility.Syntax.RemovedCurlyBraceArrayAccess
sniff to detect array and string offset access using curly braces as will be deprecated as of PHP 7.4. #855- In contrast to any other sniff in the PHPCompatibility standard, this sniff contains an auto-fixer.
- 🌟 New
PHPCompatibility.TextStrings.NewUnicodeEscapeSequence
sniff to detect use of the PHP 7.0+ unicode codepoint escape sequences and issues with invalid sequences. #856 - 🌟 New
PHPCompatibility.Upgrade.LowPHP
sniff to give users of old PHP versions advance warning when support will be dropped in the near future. #838
At this moment, the intention is to drop support for PHP 5.3 by the end of this year. - ⭐
PHPCompatibility.Classes.NewClasses
sniff: recognize the newWeakReference
class as introduced in PHP 7.4. #857 - ⭐
PHPCompatibility.Constants.NewConstants
sniff: detection of new Curl constants as introduced in PHP 7.3.5. #878 - ⭐
PHPCompatibility.Constants.NewConstants
sniff: detection of the revivedT_BAD_CHARACTER
constant as re-introduced in PHP 7.4. #882 - ⭐
PHPCompatibility.Constants.NewConstants
sniff: detection of the newIMG_FILTER_SCATTER
andPASSWORD_ARGON2_PROVIDER
constants as introduced in PHP 7.4. #887 - ⭐
PHPCompatibility.Constants.RemovedConstants
sniff: detection of use of theCURLPIPE_HTTP1
constant which will be deprecated in PHP 7.4. #879 - ⭐
PHPCompatibility.Constants.RemovedConstants
sniff: detection of use of theFILTER_SANITIZE_MAGIC_QUOTES
constant which will be deprecated in PHP 7.4. #845 - ⭐
PHPCompatibility.Constants.RemovedConstants
sniff: detection of use of theT_CHARACTER
andT_BAD_CHARACTER
constants which were removed in PHP 7.0. #882 - ⭐
PHPCompatibility.FunctionDeclarations.NewMagicMethods
sniff: recognize the new__serialize()
and__unserialize()
magic methods as introduced in PHP 7.4. #868 - ⭐
PHPCompatibility.FunctionDeclarations.NewMagicMethods
sniff: recognize the PHP 5.0__construct()
and__destruct()
magic methods. #884 - ⭐
PHPCompatibility.FunctionDeclarations.NonStaticMagicMethods
sniff: recognize the new__serialize()
and__unserialize()
magic methods as introduced in PHP 7.4. #868 - ⭐
PHPCompatibility.FunctionUse.NewFunctions
sniff: recognize the new PHP 7.4 functionimagecreatefromtga()
. #873 - ⭐
PHPCompatibility.FunctionUse.RemovedFunctionParameters
sniff: recognize the deprecation of the$age
parameter of thecurl_version()
function. #874 - ⭐
PHPCompatibility.FunctionUse.RemovedFunctions
sniff: recognize the PHP 7.4 deprecatedconvert_cyr_string()()
,ezmlm_hash()
,get_magic_quotes_gpc()
,get_magic_quotes_runtime()
,hebrevc()
,is_real()
,money_format()
andrestore_include_path()
functions. #847 - ⭐
PHPCompatibility.IniDirectives.NewIniDirectives
sniff: detect use of the new PHP 7.4zend.exception_ignore_args
ini directive. #871 - ⭐
PHPCompatibility.IniDirectives.RemovedIniDirectives
sniff: detect use of theallow_url_include
ini directive which is deprecated as of PHP 7.4. #870 - ⭐
PHPCompatibility.IniDirectives.RemovedIniDirectives
sniff: detection of use of theopcache.load_comments
directive which was removed in PHP 7.0. #883 - ⭐
PHPCompatibility.ParameterValues.NewHashAlgorithms
: recognize use of the new PHP 7.4crc32c
hash algorithm. #872 - ⭐
PHPCompatibility.TypeCasts.RemovedTypeCasts
sniff: detect usage of the(real)
type cast which will be deprecated in PHP 7.4. #844 - ⭐ Recognize the
recode
extension functionality which will be removed in PHP 7.4 (moved to PECL) in theRemovedExtensions
andRemovedFunctions
sniffs. #841 - ⭐ Recognize the
OPcache
extension functionality which was be introduced in PHP 5.5, but not yet fully accounted for in theNewFunctions
andNewIniDirectives
sniffs. #883 - ⭐ New
getCompleteTextString()
utility method to thePHPCompatibility\Sniff
class. #856 - ☔ Unit test for the
PHPCompatibility.Upgrade.LowPHPCS
sniff. - ☔ Some extra unit tests for the
PHPCompatibility.ParameterValues.NewNegativeStringOffset
,PHPCompatibility.ParameterValues.RemovedMbStringModifiers
and sniffs. #876, #877 - 📚
CONTRIBUTING.md
: Added a list of typical sources for information about changes to PHP. #875
Changed
- :pushp...
PHPCompatibility 9.2.0
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. 👏
PHPCompatibility 9.1.1
See all related issues and PRs in the 9.1.1 milestone.
Fixed
PHPCompatibility 9.1.0
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. 👏
PHPCompatibility 9.0.0
IMPORTANT: This release contains breaking changes. Please read the below information carefully before upgrading!
All sniffs have been placed in meaningful categories and a number of sniffs have been renamed to have more consistent, meaningful and future-proof names.
Both the PHPCompatibilityJoomla
[GH | Packagist] as well as the PHPCompatibilityWP
[GH | Packagist] rulesets have already been adjusted for this change and have released a new version which is compatible with this version of PHPCompatibility.
Aside from those CMS-based rulesets, this project now also offers a number of polyfill-library specific rulesets, such as PHPCompatibilityPasswordCompat
[GH | Packagist] for @ircmaxell's password_compat
libary, PHPCompatibilityParagonieRandomCompat
and PHPCompatibilityParagonieSodiumCompat
[GH | Packagist] for the Paragonie polyfills and a number of rulesets related to various polyfills offered by the Symfony project [GH | Packagist].
If your project uses one of these polyfills, please consider using these special polyfill rulesets to prevent false positives.
Also as of this version, Juliette Reinders Folmer is now officially a co-maintainer of this package.
Upgrade instructions
- If you have
<exclude name="..."/>
directives in your own project's custom ruleset which relate to sniffs from the PHPCompatibility library, you will need to update your ruleset to use the new sniff names. - If you use the new PHPCS 3.2+ inline annotations, i.e.
// phpcs:ignore Standard.Category.SniffName
, in combination with PHPCompatibility sniff names, you will need to update these annotations. - If you use neither of the above, you should be fine and upgrading should be painless.
Overview of all the sniff renames:
Old Category.SniffName | New Category.SniffName |
---|---|
PHP.ArgumentFunctionsUsage | FunctionUse.ArgumentFunctionsUsage |
PHP.CaseSensitiveKeywords | Keywords.CaseSensitiveKeywords |
PHP.ConstantArraysUsingConst | InitialValue.NewConstantArraysUsingConst |
PHP.ConstantArraysUsingDefine | InitialValue.NewConstantArraysUsingDefine |
PHP.DeprecatedFunctions | FunctionUse.RemovedFunctions |
PHP.DeprecatedIniDirectives | IniDirectives.RemovedIniDirectives |
PHP.DeprecatedMagicAutoload | FunctionNameRestrictions.RemovedMagicAutoload |
PHP.DeprecatedNewReference | Syntax.RemovedNewReference |
PHP.DeprecatedPHP4StyleConstructors | FunctionNameRestrictions.RemovedPHP4StyleConstructors |
PHP.DeprecatedTypeCasts | TypeCasts.RemovedTypeCasts |
PHP.DiscouragedSwitchContinue | ControlStructures.DiscouragedSwitchContinue |
PHP.DynamicAccessToStatic | Syntax.NewDynamicAccessToStatic |
PHP.EmptyNonVariable | LanguageConstructs.NewEmptyNonVariable |
PHP.ForbiddenBreakContinueOutsideLoop | ControlStructures.ForbiddenBreakContinueOutsideLoop |
PHP.ForbiddenBreakContinueVariableArguments | ControlStructures.ForbiddenBreakContinueVariableArguments |
PHP.ForbiddenCallTimePassByReference | Syntax.ForbiddenCallTimePassByReference |
PHP.ForbiddenClosureUseVariableNames | FunctionDeclarations.ForbiddenVariableNamesInClosureUse |
PHP.ForbiddenEmptyListAssignment | Lists.ForbiddenEmptyListAssignment |
PHP.ForbiddenFunctionParametersWithSameName | FunctionDeclarations.ForbiddenParametersWithSameName |
PHP.ForbiddenGlobalVariableVariable | Variables.ForbiddenGlobalVariableVariable |
PHP.ForbiddenNames | Keywords.ForbiddenNames |
PHP.ForbiddenNamesAsDeclared | Keywords.ForbiddenNamesAsDeclared |
PHP.ForbiddenNamesAsInvokedFunctions | Keywords.ForbiddenNamesAsInvokedFunctions |
PHP.ForbiddenNegativeBitshift | Operators.ForbiddenNegativeBitshift |
PHP.ForbiddenSwitchWithMultipleDefaultBlocks | ControlStructures.ForbiddenSwitchWithMultipleDefaultBlocks |
PHP.InternalInterfaces | Interfaces.InternalInterfaces |
PHP.LateStaticBinding | Classes.NewLateStaticBinding |
PHP.MbstringReplaceEModifier | ParameterValues.RemovedMbstringModifiers |
PHP.NewAnonymousClasses | Classes.NewAnonymousClasses |
PHP.NewArrayStringDereferencing | Syntax.NewArrayStringDereferencing |
PHP.NewClasses | Classes.NewClasses |
PHP.NewClassMemberAccess | Syntax.NewClassMemberAccess |
PHP.NewClosure | FunctionDeclarations.NewClosure |
PHP.NewConstants | Constants.NewConstants |
PHP.NewConstantScalarExpressions | InitialValue.NewConstantScalarExpressions |
PHP.NewConstVisibility | Classes.NewConstVisibility |
PHP.NewExecutionDirectives | ControlStructures.NewExecutionDirectives |
PHP.NewFunctionArrayDereferencing | Syntax.NewFunctionArrayDereferencing |
PHP.NewFunctionParameters | FunctionUse.NewFunctionParameters |
PHP.NewFunctions | FunctionUse.NewFunctions |
PHP.NewGeneratorReturn | Generators.NewGeneratorReturn |
PHP.NewGroupUseDeclarations | UseDeclarations.NewGroupUseDeclarations |
PHP.NewHashAlgorithms | ParameterValues.NewHashAlgorithms |
PHP.NewHeredocInitialize | InitialValue.NewHeredoc |
PHP.NewIniDirectives | IniDirectives.NewIniDirectives |
PHP.NewInterfaces | Interfaces.NewInterfaces |
PHP.NewKeywords | Keywords.NewKeywords |
PHP.NewLanguageConstructs | LanguageConstructs.NewLanguageConstructs |
PHP.NewMagicClassConstant | Constants.NewMagicClassConstant |
PHP.NewMagicMethods | FunctionNameRestrictions.NewMagicMethods |
PHP.NewMultiCatch | ControlStructures.NewMultiCatch |
PHP.NewNullableTypes | FunctionDeclarations.NewNullableTypes |
PHP.NewReturnTypeDeclarations | FunctionDeclarations.NewReturnTypeDeclarations |
PHP.NewScalarTypeDeclarations | FunctionDeclarations.NewParamTypeDeclarations |
PHP.NewTrailingComma | Syntax.NewFunctionCallTrailingComma |
PHP.NewTypeCasts | TypeCasts.NewTypeCasts |
PHP.NewUseConstFunction | UseDeclarations.NewUseConstFunction |
PHP.NonStaticMagicMethods | FunctionDeclarations.NonStaticMagicMethods |
PHP.OptionalRequiredFunctionParameters | FunctionUse.OptionalToRequiredFunctionParameters |
PHP.ParameterShadowSuperGlobals | FunctionDeclarations.ForbiddenParameterShadowSuperGlobals |
PHP.PCRENewModifiers | ParameterValues.NewPCREModifiers |
PHP.PregReplaceEModifier | ParameterValues.RemovedPCREModifiers |
PHP.RemovedAlternativePHPTags | Miscellaneous.RemovedAlternativePHPTags |
PHP.RemovedConstants | Constants.RemovedConstants |
PHP.RemovedExtensions | Extensions.RemovedExtensions |
PHP.RemovedFunctionParameters | FunctionUse.RemovedFunctionParameters |
PHP.RemovedGlobalVariables | Variables.RemovedPredefinedGlobalVariables |
PHP.RemovedHashAlgorithms | ParameterValues.RemovedHashAlgorithms |
PHP.ReservedFunctionNames | FunctionNameRestrictions.ReservedFunctionNames |
PHP.RequiredOptionalFunctionParameters | FunctionUse.RequiredToOptionalFunctionParameters |
PHP.ShortArray | Syntax.NewShortArray |
PHP.TernaryOperators | Operators.NewShortTernary |
PHP.ValidIntegers | Miscellaneous.ValidIntegers |
PHP.VariableVariables | Variables.NewUniformVariableSyntax |
Changelog for version 9.0.0
See all related issues and PRs in the 9.0.0 milestone.
Added
- 🌟 New
PHPCompatibility.ControlStructures.NewForeachExpressionReferencing
sniff to detect referencing of$value
within aforeach()
when the iterated array is not a variable. This was not supported prior to PHP 5.5. #664 - 🌟 New
PHPCompatibility.ControlStructures.NewListInForeach
sniff to detect unpacking nested arrays into separate variables via thelist()
construct in aforeach()
statement. This was not supported prior to PHP 5.5. #657 - 🌟 New
PHPCompatibility.FunctionNameRestrictions.RemovedNamespacedAssert
sniff to detect declaring a function calledassert()
within a namespace. This has been deprecated as of PHP 7.3. #735. Partially fixes #718. - 🌟 New
PHPCompatibility.Lists.AssignmentOrder
sniff to detectlist()
constructs affected by the change in assignment order in PHP 7.0. #656 - 🌟 New
PHPCompatibility.Lists.NewKeyedList
sniff to detect usage of keys inlist()
, support for which was added in PHP 7.1. #655. Fixes [#252](ht...