Update wimg/php-compatibility in / from 8.1.0 to 8.2.0 #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dependencies.io has updated
wimg/php-compatibility
(a packagist dependency in/
) from "8.1.0" to "8.2.0".8.2.0
Important changes
The repository has moved
As of July 13 2018, the PHPCompatibility repository has moved from the personal account of Wim Godden
wimg
to its own organizationPHPCompatibility
.Composer users are advised to update their
composer.json
. The dependency is now calledphpcompatibility/php-compatibility
.Framework/CMS specific PHPCompatibility rulesets
Within this new organization, hosting will be offered for framework/CMS specific PHPCompatibility rulesets.
The first two such repositories have been created and are now available for use:
If you want to make sure you have all PHPCompatibility rulesets available at any time, you can use the PHPCompatibilityAll package GitHub|Packagist.
For more information, see the Readme and Contributing guidelines.
Changes expected in PHPCompatibility 9.0.0
The next version of PHPCompatibility will include a major directory layout restructuring which means that the sniff codes of all sniffs will change.
In this same release, support for PHP_CodeSniffer 1.5.x will be dropped. The new minimum supported PHPCS version will be 2.3.0.
For more information about these upcoming changes, please read the announcement.
The
9.0.0
release is expected to be ready later this summer.See all related issues and PRs in the [8.2.0 milestone].
Added
ArgumentFunctionsUsage
sniff to detect usage of thefunc_get_args()
,func_get_arg()
andfunc_num_args()
functions and the changes regarding these functions introduced in PHP 5.3. #596. Fixes #372.DiscouragedSwitchContinue
sniff to detectcontinue
targetting aswitch
control structure for whichE_WARNINGS
will be thrown as of PHP 7.3. #687NewClassMemberAccess
sniff to detect class member access on instantiation as added in PHP 5.4 and class member access on cloning as added in PHP 7.0. #619. Fixes #53.NewConstantScalarExpressions
sniff to detect PHP 5.6 scalar expression in contexts where PHP previously only allowed static values. #617. Fixes #399.NewGeneratorReturn
sniff to detectreturn
statements within generators as introduced in PHP 7.0. #618PCRENewModifiers
sniff to initially detect the newJ
regex modifier as introduced in PHP 7.2. #600. Fixes #556.ReservedFunctionNames
sniff to report on double underscore prefixed functions and methods. This was previously reported via an upstream sniff. #581NewTrailingComma
sniff to detect trailing comma's in function calls, method calls,isset()
andunset()
as will be introduced in PHP 7.3. #632Upgrade/LowPHPCS
sniff to give users of old PHP_CodeSniffer versions advance warning when support will be dropped in the near future. #693NewClasses
sniff: check for some 40+ additional PHP native classes added in various PHP versions. #573NewClosure
sniff: check for usage ofself
/parent
/static::
being used within closures, support for which was only added in PHP 5.4. #669. Fixes #668.NewConstants
sniff: recognize constants added by the PHP 5.5+ password extension. #626NewFunctionParameters
sniff: recognize a number of additional function parameters added in PHP 7.0, 7.1 and 7.2. #602NewFunctions
sniff: recognize the PHP 5.1 SPL extension functions, the PHP 5.1.1hash_hmac()
function, the PHP 5.6pg_lo_truncate()
function, more PHP 7.2 Sodium functions and the new PHP 7.3is_countable()
function. #606, #625, #640, #651NewHashAlgorithms
sniff: recognize the new hash algorithms which were added in PHP 7.1. #599NewInterfaces
sniff: check for the PHP 5.0Reflector
interface. #572OptionalRequiredFunctionParameters
sniff: detect missing$salt
parameter in calls to thecrypt()
function (PHP 5.6+). #605RequiredOptionalFunctionParameters
sniff: recognize that the$varname
parameter ofgetenv()
and the$scale
parameter ofbcscale()
have become optional as of PHP 7.1 and 7.3 respectively. #598, #612AbstractFunctionCallParameterSniff
to be used as a basis for sniffs examining function call parameters. #636getReturnTypeHintName()
utility method to thePHPCompatibility\Sniff
class. #578, #642isNumber()
,isPositiveNumber()
andisNegativeNumber()
utility methods to thePHPCompatibility\Sniff
class. #610, #650isShortList()
utility method to thePHPCompatibility\Sniff
class. #635getCommandLineData()
method to thePHPCompatibility\PHPCSHelper
class to provide PHPCS cross-version compatible access to command line info at run time. #693findEndOfStatement()
method to thePHPCompatibility\PHPCSHelper
class to allow for PHPCS cross-version usage of that method. #614PHPCompatibility\Sniff::isUseOfGlobalConstant()
method handles multi-constant declarations correctly. #587PHPCompatibility\Sniff::isClassProperty()
method handles multi-property declarations correctly. #583testVersion
in a custom ruleset to be overruled by the command-line. #607Changed
This repository will now live in https://github.com/PHPCompatibility/PHPCompatibility and the Packagist reference will now be
phpcompatibility/php-compatibility
.getReturnTypeHintToken()
utility method has been made compatible with the changes in the PHPCS tokenizer which were introduced in PHP_CodeSniffer 3.3.0. #642. Fixes #639.ConstantArrayUsingConst
: improved handling of multi-constant declarations. #593NewHeredocInitialize
: improved handling of constant declarations using theconst
keyword.The sniff will now also report on multi-declarations for variables, constants and class properties and on using heredoc as a function parameter default. #641
ForbiddenEmptyListAssignment
: this sniff will now also report on empty list assignments when the PHP 7.1 short list syntax is used. #653ForbiddenNegativeBitshift
sniff would previously only report on "bitshift right". As of this version, "bitshift left" and bitshift assignments will also be recognized. #614NewClasses
andNewInterfaces
sniffs will now also report on new classes/interfaces when used as return type declarations. #578NewScalarTypeDeclarations
sniff will now recognizeparent
as a valid type declaration.The sniff will now also throw an error about using
self
andparent
when PHP < 5.2 needs to be supported as PHP 5.1 and lower would presume these to be class names instead of keywords. #595PregReplaceEModifier
sniff - and thePCRENewModifiers
sniff by extension - will now correctly examine and report on modifiers in regexes passed via calls topreg_replace_callback_array()
. #600, #636getReturnTypeHintToken()
utility method: improved support for interface methods and abstract function declarations. #652findExtendedClassName()
,findImplementedInterfaceNames()
,getMethodParameters()
utility methods which are duplicates of upstream PHPCS methods, have been moved from thePHPCompatibility\Sniff
class to thePHPCompatibility\PHPCSHelper
class and have become static methods. #613getReturnTypeHintToken()
utility method: align returned$stackPtr
with native PHPCS behaviour by returning the last token of the type declaration. #575getMethodParameters()
method with improved upstream version. #643MbstringReplaceEModifier
,PregReplaceEModifier
and thePregReplaceEModifier
sniffs nowextend
the newAbstractFunctionCallParameterSniff
class. This should yield more accurate results when checking whether one of the target PHP functions was called. #636DeprecatedNewReference
sniff: minor change to the error text and code - wasForbidden
, nowRemoved
-. Custom rulesets which explicitly excluded this error code will need to be updated. #594NewScalarTypeDeclarations
sniff: minor change to the error message text.#644PHP
. #634roave/security-advisories
, allowing for PHPUnit 7.x. #604, #616, #622, #646composer.json
file, validation of the framework specific rulesets. #570, #571, #579, #621, #631Removed
Generic.NamingConventions.CamelCapsFunctionName
. Double underscore prefixed function names are now being reported on by a new dedicated sniff. #581For now, running PHPCompatibility on HHVM to test PHP code may still work for a little while, but HHVM has announced they are dropping PHP support. #623. Fixes #603.
Fixed
Generic.NamingConventions.CamelCapsFunctionName
sniff was included in PHPCompatibility. Some error codes of this sniff were excluded, as well as some error messages changed (via the ruleset).If/when PHPCompatibility would be used in combination with a code style-type ruleset, this could inadvertently lead to underreporting of issues which the CS-type ruleset intends to have reported - i.e. the error codes excluded by PHPCompatibility -. This has now been fixed. #581
ForbiddenNegativeBitshift
sniff would incorrectly throw an error when a bitshift was based on a calculation which included a negative number, but would not necessarily result in a negative number. #614. Fixes #294, #466.NewClosure
sniff would report the same issue twice when the issue was encountered in a nested closure. #669NewKeywords
sniff would underreport on non-lowercase keywords. #627NewKeywords
sniff would incorrectly report on the use of class constants and class properties using the same name as a keyword. #627NewNullableTypes
sniff would potentially underreport when comments where interspersed in the (return) type declarations. #577Sniff::getFunctionCallParameters()
utility method would in rare cases return incorrect results when it encountered a closure as a parameter. #682Sniff::getReturnTypeHintToken()
utility method would not always return a$stackPtr
. #645PHPCompatibility\Tests\BaseClass\MethodTestFrame::getTargetToken()
could potentially not find the correct token to run a test against. #588Credits
Thanks go out to Michael Babker and Juliette Reinders Folmer for their contributions to this version. 👏