-
-
Notifications
You must be signed in to change notification settings - Fork 8
Comparing changes
Open a pull request
base repository: PHPCSStandards/PHPCSUtils
base: develop
head repository: PHPCSStandards/PHPCSUtils
compare: feature/ghactions-update-for-new-upstream-4-branch
- 17 commits
- 58 files changed
- 1 contributor
Commits on Jun 2, 2025
-
More precisely match the namespace prefix of this project (to prevent matching on projects extending this project and using an overlapping namespace name).
Configuration menu - View commit details
-
Copy full SHA for 3c43571 - Browse repository at this point
Copy the full SHA 3c43571View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1be7e49 - Browse repository at this point
Copy the full SHA 1be7e49View commit details -
Configuration menu - View commit details
-
Copy full SHA for 750677d - Browse repository at this point
Copy the full SHA 750677dView commit details -
BCTokens: sync with PHPCS 4.0 [1] / removed JS tokens
PHPCSStandards/PHP_CodeSniffer 983 (JS/CSS support drop) removes the `T_ZSR_EQUAL`, `T__PROPERTY` and `T_OBJECT` tokens, including removing them from the `Tokens::$assignmentTokens`, `Tokens::$blockOpeners` and `Tokens::$scopeOpeners` token arrays. This commit aligns these token arrays in the `BCFile` class with their PHPCS 4.0 contents. Includes updated tests.
Configuration menu - View commit details
-
Copy full SHA for 11220f0 - Browse repository at this point
Copy the full SHA 11220f0View commit details -
BCTokens: sync with PHPCS 4.0 [2] / anon class is function name token
PHPCSStandards/PHP_CodeSniffer 47 adds the `T_ANON_CLASS` token to the `Tokens::$functionNameTokens` array. Includes updated tests.
Configuration menu - View commit details
-
Copy full SHA for af5c339 - Browse repository at this point
Copy the full SHA af5c339View commit details -
BCTokens: sync with PHPCS 4.0 [3] / closure use is parenthesis owner
PHPCSStandards/PHP_CodeSniffer 1013 made `T_USE` for closure use a parenthesis owner. While the token will now be included in the `BCTokens::parenthesisOpeners()` return value, while on PHPCS 3.x, it will still not be a parentheses owner. Use the methods in the `Parentheses` class to work out whether `T_USE` is actually a parenthesis owner in a PHPCS cross-version compatible manner (commit upcoming). Includes updated tests.
Configuration menu - View commit details
-
Copy full SHA for 446f3f1 - Browse repository at this point
Copy the full SHA 446f3f1View commit details -
BCTokens: sync with PHPCS 4.0 [4] / more parenthesis owners
PHPCSStandards/PHP_CodeSniffer 1014 made `T_ISSET`, `T_UNSET`, `T_EMPTY`, `T_EVAL` and `T_EXIT` parenthesis owners. While the token will now be included in the `BCTokens::parenthesisOpeners()` return value, while on PHPCS 3.x, they will still not be parentheses owners. Use the methods in the `Parentheses` class to work out whether any of these tokens is actually a parenthesis owner in a PHPCS cross-version compatible manner. Note: The `Parentheses` methods have supported these tokens as parenthesis owners since PHPCSUtils 1.0.0. Includes updated tests.
Configuration menu - View commit details
-
Copy full SHA for 1c97ada - Browse repository at this point
Copy the full SHA 1c97adaView commit details -
BCTokens: sync with PHPCS 4.0 [5] / namespaced name tokens
PHPCSStandards/PHP_CodeSniffer 1020 (namespaced names) adds a new `Tokens::NAME_TOKENS` token array and also adds these tokens to the `Tokens::$functionNameTokens` token array. This last bit was already handled previously. This commit now adds the mirror function for the `Tokens::NAME_TOKENS` token array. Includes updated tests.
Configuration menu - View commit details
-
Copy full SHA for 0d746f0 - Browse repository at this point
Copy the full SHA 0d746f0View commit details -
UtilityMethodTestCase: make compatible with PHPCS 4.0
This commit introduces a test double for the PHPCS native `Ruleset` class. PHPCS >= 4.0 is stricter about registering sniffs, so when "mocking" a registered sniff, it will throw a "No sniffs were registered." `RuntimeException`. Most utility method tests don't need for any sniffs to be registered, they just need a `Ruleset` object to be available to allow for creating a `File` object. This test double accommodates that by catching the exception.
Configuration menu - View commit details
-
Copy full SHA for ad2929f - Browse repository at this point
Copy the full SHA ad2929fView commit details -
Tests: deal with difference in tokenization of PHP open tag in PHPCS 4.0
The whitespace which may be included in a long PHP open tag is tokenized as a separate `T_WHITESPACE` token as of PHPCS 4.0. This commit updates token position expectations to take this into account. Related to upstream: * PHPCSStandards/PHP_CodeSniffer 593 * PHPCSStandards/PHP_CodeSniffer 1015
Configuration menu - View commit details
-
Copy full SHA for 9968b19 - Browse repository at this point
Copy the full SHA 9968b19View commit details -
Parentheses::getOwner(): T_USE is now a parenthesis owner
`T_USE` tokens used for closure use statements are parentheses owners as of PHPCS 4.0.0. This commit updated the `Parentheses::getOwner()` method to treat closure `T_USE` tokens as parentheses owners, PHPCS cross-version. Includes additional unit tests for this case. Refs: * PHPCSStandards/PHP_CodeSniffer 1013 * squizlabs/PHP_CodeSniffer 2593 * squizlabs/PHP_CodeSniffer 3104
Configuration menu - View commit details
-
Copy full SHA for 5f18caf - Browse repository at this point
Copy the full SHA 5f18cafView commit details -
BCFile::getMethodParameters(): sync with PHPCS 4.0 / T_USE is parenth…
…esis owner This change was already previously handled in PHPCSUtils. This commit just syncs in the new tests as introduced upstream. Ref: PHPCSStandards/PHP_CodeSniffer 1013
Configuration menu - View commit details
-
Copy full SHA for cce8e45 - Browse repository at this point
Copy the full SHA cce8e45View commit details -
BCFile::getMemberProperties(): sync with PHPCS 4.0 / remove parse err…
…or warning + PHP 8.4 interface properties As of PHPCS 4.0, the `File::getMemberProperties()` method: * ... will handle properties in interfaces to support PHP 8.4, in which this is now allowed. * ... will no longer throw a parse error warning. This commit makes the necessary updates in PHPCSUtils for the same: * Adds `T_INTERFACE` to the `Collections::ooPropertyScopes()` for PHP 8.4 properties in interfaces support. * Updates the test expectations for the `Scopes::isOOProperty()` method to allow for PHP 8.4 properties in interfaces. * Updates the `BCFile::getMemberProperties()` polyfill to mirror the PHPCS 4.0 version of the method. * Updates various tests for both the `BCFile::getMemberProperties()` and the `Variables::getMemberProperties()` methods to be in line with the changes. Ref: PHPCSStandards/PHP_CodeSniffer 991
Configuration menu - View commit details
-
Copy full SHA for 48e298f - Browse repository at this point
Copy the full SHA 48e298fView commit details -
BCFile::getDeclarationName(): sync with PHPCS 4.0 / stop accepting to…
…kens for non-named structures The `[BC]File::getDeclarationName()` method - for historic reasons - accepted the `T_CLOSURE` and `T_ANON_CLASS` tokens, even though these structures will never have a name, and returned `null` for those tokens. This commit changes the `BCFile::getDeclarationName()` method to no longer accept those tokens and throw an exception if they are passed to the method instead. As a secondary change, when the name of a valid structure cannot be determined, the method will now no longer return `null`, but will return an empty string. This normalizes the return type of the method to always return a string (or throw an exception). Includes updated unit tests to match. This change mirrors the upstream change made to the `File::getDeclarationName()` method in PHPCS 4.0. Note: this change is NOT mirrored in the `ObjectDeclarations::getName()` method, as changing it there would constitute a breaking change for PHPCSUtils, so that change needs to wait until PHPCSUtils 2.0. Ref: PHPCSStandards/PHP_CodeSniffer 1007
Configuration menu - View commit details
-
Copy full SHA for 09b13c1 - Browse repository at this point
Copy the full SHA 09b13c1View commit details -
BCFile::findExtendedClassName(): sync with PHPCS 4.0 / handling of na…
…mespace relative parent classes The PHPCS `File::findExtendedClassName()` method did not handle namespace relative parent classes correctly prior to PHPCS 4.0. The PHPCSUtils native `ObjectDeclarations::findExtendedClassName()` method **_did_** already handle this correctly. This commit adds the PHPCS 4.x version of the `findExtendedClassName()` method to the `BCFile` class. Includes moving related tests from the "Diff" test file to the "normal" test file and updating the docs to annotate this is no longer a difference between the PHPCS native and PHPCSUtils versions of the method.
Configuration menu - View commit details
-
Copy full SHA for 986bb31 - Browse repository at this point
Copy the full SHA 986bb31View commit details -
BCFile::findImplementedInterfaceNames(): sync with PHPCS 4.0 / handli…
…ng of namespace relative interfaces The PHPCS `File::findImplementedInterfaceNames()` method did not handle namespace relative interfaces correctly prior to PHPCS 4.0. The PHPCSUtils native `ObjectDeclarations::findImplementedInterfaceNames()` method **_did_** already handle this correctly. This commit adds the PHPCS 4.x version of the `findImplementedInterfaceNames()` method to the `BCFile` class. Includes moving related tests from the "Diff" test file to the "normal" test file and updating the docs to annotate this is no longer a difference between the PHPCS native and PHPCSUtils versions of the method.
Configuration menu - View commit details
-
Copy full SHA for 6c70a6a - Browse repository at this point
Copy the full SHA 6c70a6aView commit details -
WIP / not working yet - test workflow + GetVersionTest, rest should b…
…e fine | Make PHPCS 4.x support official
Configuration menu - View commit details
-
Copy full SHA for c8586f1 - Browse repository at this point
Copy the full SHA c8586f1View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff develop...feature/ghactions-update-for-new-upstream-4-branch