Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency wimg/php-compatibility to v9 #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Oct 7, 2018

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
wimg/php-compatibility (source) ^8 -> ^9 age adoption passing confidence

Release Notes

PHPCompatibility/PHPCompatibility (wimg/php-compatibility)

v9.3.5

Compare Source

See all related issues and PRs in the [9.3.5 milestone].

Added
  • PHPCompatibility.Classes.NewClasses sniff: recognize the new FFI extension related classes as introduced in PHP 7.4. #​949
  • PHPCompatibility.IniDirectives.NewIniDirectives sniff: detect use of the new FFI 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. 👏

v9.3.4

Compare Source

See all related issues and PRs in the [9.3.4 milestone].

Fixed
  • 🐛 PHPCompatibility.Keywords.ForbiddenNames: false positive for list when used in a foreach() condition. #​930. Fixes #​928, #​929
Credits

Thanks go out to [Sergii Bondarenko] for their contribution to this version. 👏

v9.3.3

Compare Source

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. 👏

v9.3.2

Compare Source

See all related issues and PRs in the [9.3.2 milestone].

Added
  • PHPCompatibility.Constants.NewConstants sniff: detection of the PHP 7.2 SODIUM_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 now protected, it should never have been public 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 uppercase B were not always recognized correctly. #​909

v9.3.1

Compare Source

See all related issues and PRs in the [9.3.1 milestone].

Changed
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.

v9.3.0

Compare Source

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 to strip_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 to html_entity_decode(), htmlentities() and htmlspecialchars() 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 the default_charset value in PHP 5.6. #​864 Fixes #​839
  • 🌟 New PHPCompatibility.ParameterValues.NewIDNVariantDefault sniff to detect calls to idn_to_ascii() and idn_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 to password_hash() and password_needs_rehash() impacted by the changed value of the PASSWORD_DEFAULT, PASSWORD_BCRYPT, PASSWORD_ARGON2I and PASSWORD_ARGON2ID constants in PHP 7.4. #​865
  • 🌟 New PHPCompatibility.ParameterValues.NewProcOpenCmdArray sniff to detect calls to proc_open() passing an array for the $cmd parameter as supported as of PHP 7.4. #​869
  • 🌟 New PHPCompatibility.ParameterValues.NewStripTagsAllowableTagsArray sniff to detect calls to strip_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 detect implode() 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, to mb_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 new WeakReference 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 revived T_BAD_CHARACTER constant as re-introduced in PHP 7.4. #​882
  • PHPCompatibility.Constants.NewConstants sniff: detection of the new IMG_FILTER_SCATTER and PASSWORD_ARGON2_PROVIDER constants as introduced in PHP 7.4. #​887
  • PHPCompatibility.Constants.RemovedConstants sniff: detection of use of the CURLPIPE_HTTP1 constant which will be deprecated in PHP 7.4. #​879
  • PHPCompatibility.Constants.RemovedConstants sniff: detection of use of the FILTER_SANITIZE_MAGIC_QUOTES constant which will be deprecated in PHP 7.4. #​845
  • PHPCompatibility.Constants.RemovedConstants sniff: detection of use of the T_CHARACTER and T_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 function imagecreatefromtga(). #​873
  • PHPCompatibility.FunctionUse.RemovedFunctionParameters sniff: recognize the deprecation of the $age parameter of the curl_version() function. #​874
  • PHPCompatibility.FunctionUse.RemovedFunctions sniff: recognize the PHP 7.4 deprecated convert_cyr_string()(), ezmlm_hash(), get_magic_quotes_gpc(), get_magic_quotes_runtime(), hebrevc(), is_real(), money_format() and restore_include_path() functions. #​847
  • PHPCompatibility.IniDirectives.NewIniDirectives sniff: detect use of the new PHP 7.4 zend.exception_ignore_args ini directive. #​871
  • PHPCompatibility.IniDirectives.RemovedIniDirectives sniff: detect use of the allow_url_include ini directive which is deprecated as of PHP 7.4. #​870
  • PHPCompatibility.IniDirectives.RemovedIniDirectives sniff: detection of use of the opcache.load_comments directive which was removed in PHP 7.0. #​883
  • PHPCompatibility.ParameterValues.NewHashAlgorithms: recognize use of the new PHP 7.4 crc32c 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 the RemovedExtensions and RemovedFunctions sniffs. #​841
  • ⭐ Recognize the OPcache extension functionality which was be introduced in PHP 5.5, but not yet fully accounted for in the NewFunctions and NewIniDirectives sniffs. #​883
  • ⭐ New getCompleteTextString() utility method to the PHPCompatibility\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
  • 📌 PHPCompatibility.FunctionDeclarations.NewExceptionsFromToString sniff: the sniff will now also examine the function docblock, if available, and will throw an error when a @throws tag is found in the docblock. #​880. Fixes #​863
  • 📌 PHPCompatibility.FunctionDeclarations.NonStaticMagicMethods sniff: will now also check the visibility and static (or not) requirements of the magic __construct(), __destruct(), __clone(), __debugInfo(), __invoke() and __set_state() methods. #​885
  • 📌 PHPCompatibility.Syntax.NewArrayStringDereferencing sniff: the sniff will now also recognize array string dereferencing using curly braces as was (silently) supported since PHP 7.0. #​851
    • The sniff will now also throw errors for each dereference found on the array/string, not just the first one.
  • 📌 PHPCompatibility.Syntax.NewClassMemberAccess sniff: the sniff will now also recognize class member access on instantiation and cloning using curly braces as was (silently) supported since PHP 7.0. #​852
    • The sniff will now also throw errors for each access detected, not just the first one.
    • The line number on which the error is thrown in now set more precisely.
  • 📌 PHPCompatibility.Syntax.NewFunctionArrayDereferencing sniff: the sniff will now also recognize function array dereferencing using curly braces as was (silently) supported since PHP 7.0. #​853
    • The sniff will now also throw errors for each access detected, not just the first one.
    • The line number on which the error is thrown in now set more precisely.
  • ♻️ Various code clean-up and improvements. #​849, #​850
  • ♻️ Various minor inline documentation fixes. #​854, #​886
  • 🔧 Travis: various tweaks to the build script. #​834, #​842
Fixed
  • 🐛 PHPCompatibility.FunctionDeclarations.ForbiddenParametersWithSameName sniff: variable names are case-sensitive, so recognition of same named parameters should be done in a case-sensitive manner. #​848
  • 🐛 PHPCompatibility.FunctionDeclarations.NewExceptionsFromToString sniff: Exceptions thrown within a try should not trigger the sniff. #​880. Fixes #​863
  • 🐛 PHPCompatibility.FunctionDeclarations.NewExceptionsFromToString sniff: the $ooScopeTokens property should never have been a public property. #​880.
  • ☔ Some of the unit tests for the PHPCompatibility.Operators.RemovedTernaryAssociativity sniff were not being run. #​836

v9.2.0

Compare Source

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 both private as well as abstract. This was allowed between PHP 5.0.0 and 5.0.4, but disallowed in PHP 5.1 as the behaviour of private and abstract 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 the parent 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 new ReflectionReference 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.4 get_mangled_object_vars(), mb_str_split(), openssl_x509_verify(), password_algos(), pcntl_unshare(), sapi_windows_set_ctrl_handler() and sapi_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 deprecated ldap_control_paged_result_response() and ldap_control_paged_result() functions. #​831
  • PHPCompatibility.FunctionUse.RemovedFunctions sniff: recognize the Payflow Pro/pfpro functions as removed in PHP 5.1. #​823
  • PHPCompatibility.FunctionUse.RequiredToOptionalFunctionParameters sniff: account for the parameters for array_merge() and array_merge_recursive() becoming optional in PHP 7.4. #​817
  • PHPCompatibility.IniDirectives.RemovedIniDirectives sniff: recognize the Payflow 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 the RemovedConstants, RemovedExtensions, RemovedFunctions and RemovedIniDirectives sniffs. #​807
  • ⭐ Recognize the wddx extension functionality which will be removed in PHP 7.4 (moved to PECL) in the RemovedExtensions and RemovedFunctions sniffs. #​826
  • ⭐ New isShortTernary() and isUnaryPlusMinus() utility methods to the PHPCompatibility\Sniff class. #​810, #​805
Changed
  • ✏️ The PHPCompatibility.Extensions.RemovedExtensions sniff will now only report on the removed Payflow Pro extension when a function uses pfpro_ as a prefix. Previously, it used the pfpro 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 for PHP_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 to 0.5.0. #​791
Fixed
  • 🐛 The PHPCompatibility.Extensions.RemovedExtensions sniff contained a typo in the alternative recommended for the removed mcve extension. #​806
  • 🐛 The PHPCompatibility.Extensions.RemovedExtensions sniff listed the wrong removal version number for the Payflow 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. 👏

v9.1.1

Compare Source

See all related issues and PRs in the [9.1.1 milestone].

Fixed
  • 🐛 ForbiddenThisUseContexts: false positive for unsetting $this['key'] on objects implementing ArrayAccess. #​781. Fixes #​780

v9.1.0

Compare Source

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 by func_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 new imap.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 the PHPCompatibility\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 return false when no valid direct scope has been found, but it will now return the stackPtr to the scope token if a valid direct scope was encountered. #​758
  • NewOperators : updated the version number for T_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. 👏

v9.0.0

Compare Source

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 a foreach() 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 the list() construct in a foreach() statement. This was not supported prior to PHP 5.5. #​657
  • 🌟 New PHPCompatibility.FunctionNameRestrictions.RemovedNamespacedAssert sniff to detect declaring a function called assert() within a namespace. This has been deprecated as of PHP 7.3. #​735. Partially fixes #​718.
  • 🌟 New PHPCompatibility.Lists.AssignmentOrder sniff to detect list() constructs affected by the change in assignment order in PHP 7.0. #​656
  • 🌟 New PHPCompatibility.Lists.NewKeyedList sniff to detect usage of keys in list(), support for which was added in PHP 7.1. #​655. Fixes #​252.
  • 🌟 New PHPCompatibility.Lists.NewListReferenceAssignment sniff to detect reference assignments being used in list() constructs, support for which has been added in PHP 7.3. #​731
  • 🌟 New PHPCompatibility.Lists.NewShortList sniff to detect the shorthand array syntax [] being used for symmetric array destructuring as introduced in PHP 7.1. #​654. Fixes #​248.
  • 🌟 New PHPCompatibility.Operators.NewOperators sniff which checks for usage of the pow, pow equals, spaceship and coalesce (equals) operators. #​738
    These checks were previously contained within the PHPCompatibility.LanguageConstructs.NewLanguageConstructs sniff.
  • 🌟 New PHPCompatibility.ParameterValues.ForbiddenGetClassNull sniff to detect null being passed to get_class(), support for which has been removed in PHP 7.2 #​659. Fixes #​557.
  • 🌟 New PHPCompatibility.ParameterValues.NewArrayReduceInitialType sniff to detect non-integers being passed as the $initial parameter to the array_reduce() function, which was not supported before PHP 5.3. #​666. Fixes #​649
  • 🌟 New PHPCompatibility.ParameterValues.NewFopenModes sniff to examine the $mode parameter passed to fopen() for modes not available in older PHP versions. #​658
  • 🌟 New PHPCompatibility.ParameterValues.NewNegativeStringOffset sniff to detect negative string offsets being passed to string manipulation functions which was not supported before PHP 7.1. #​662. Partially fixes #​253.
  • 🌟 New PHPCompatibility.ParameterValues.NewPackFormats sniff to examine the $format parameter passed to pack() for formats not available in older PHP versions. #​665
  • 🌟 New PHPCompatibility.ParameterValues.RemovedIconvEncoding sniff to detect the PHP 5.6 deprecated encoding $types being passed to iconv_set_encoding(). #​660. Fixes #​475.
  • 🌟 New PHPCompatibility.ParameterValues.RemovedNonCryptoHashes sniff to detect non-cryptographic hash algorithms being passed to various hash_*() functions. This is no longer accepted as of PHP 7.2. #​663. Fixes #​559
  • 🌟 New PHPCompatibility.ParameterValues.RemovedSetlocaleString sniff to detect string literals being passed to the $category parameter of the setlocale() function. This behaviour was deprecated in PHP 4.2 and support has been removed in PHP 7.0. #​661
  • 🌟 New PHPCompatibility.Syntax.NewFlexibleHeredocNowdoc sniff to detect the new heredoc/nowdoc format as allowed as of PHP 7.3. #​736. Fixes #​705.
    Note: This sniff is only supported in combination with PHP_CodeSniffer 2.6.0 and higher.
  • PHPCompatibility.Classes.NewClasses sniff: recognize the new CompileError and JsonException classes as introduced in PHP 7.3. #​676
  • PHPCompatibility.Constants.NewConstants sniff: recognize new constants which are being introduced in PHP 7.3. #​678
  • PHPCompatibility.Constants.RemovedConstants sniff: recognize constants which have been deprecated or removed in PHP 7.3. #​710. Partially fixes #​718.
  • PHPCompatibility.FunctionUse.NewFunctions sniff: recognize various new functions being introduced in PHP 7.3. #​679
  • PHPCompatibility.FunctionUse.NewFunctions sniff: recognize the sapi_windows_*(), hash_hkdf() and pcntl_signal_get_handler() functions as introduced in PHP 7.1. #​728
  • PHPCompatibility.FunctionUse.RemovedFunctionParameters sniff: recognize the deprecation of the $case_insensitive parameter for the define() function in PHP 7.3. #​706
  • PHPCompatibility.FunctionUse.RemovedFunctions sniff: recognize the PHP 7.3 deprecation of the image2wbmp(), fgetss() and gzgetss() functions, as well as the deprecation of undocumented Mbstring function aliases. [#​681](https://togithub.com/PHPCompatibility

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/wimg-php-compatibility-9.x branch from 96b695c to 55eeba6 Compare April 26, 2021 16:32
@renovate renovate bot force-pushed the renovate/wimg-php-compatibility-9.x branch 2 times, most recently from d7f7b52 to 46c6c73 Compare May 15, 2021 20:56
@renovate renovate bot force-pushed the renovate/wimg-php-compatibility-9.x branch from 46c6c73 to fc52b7c Compare November 20, 2022 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants