Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: PHPCSStandards/PHPCSUtils
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: develop
Choose a base ref
...
head repository: PHPCSStandards/PHPCSUtils
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: feature/ghactions-update-for-new-upstream-4-branch
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 17 commits
  • 58 files changed
  • 1 contributor

Commits on Jun 2, 2025

  1. Autoloader: minor tweak

    More precisely match the namespace prefix of this project (to prevent matching on projects extending this project and using an overlapping namespace name).
    jrfnl committed Jun 2, 2025
    Copy the full SHA
    3c43571 View commit details
  2. Copy the full SHA
    1be7e49 View commit details
  3. TEMP/TESTING

    jrfnl committed Jun 2, 2025
    Copy the full SHA
    750677d View commit details
  4. 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.
    jrfnl committed Jun 2, 2025
    Copy the full SHA
    11220f0 View commit details
  5. 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.
    jrfnl committed Jun 2, 2025
    Copy the full SHA
    af5c339 View commit details
  6. 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.
    jrfnl committed Jun 2, 2025
    Copy the full SHA
    446f3f1 View commit details
  7. 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.
    jrfnl committed Jun 2, 2025
    Copy the full SHA
    1c97ada View commit details
  8. 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.
    jrfnl committed Jun 2, 2025
    Copy the full SHA
    0d746f0 View commit details
  9. 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.
    jrfnl committed Jun 2, 2025
    Copy the full SHA
    ad2929f View commit details
  10. 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
    jrfnl committed Jun 2, 2025
    Copy the full SHA
    9968b19 View commit details
  11. 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
    jrfnl committed Jun 2, 2025
    Copy the full SHA
    5f18caf View commit details
  12. 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
    jrfnl committed Jun 2, 2025
    Copy the full SHA
    cce8e45 View commit details
  13. 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
    jrfnl committed Jun 2, 2025
    Copy the full SHA
    48e298f View commit details
  14. 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
    jrfnl committed Jun 2, 2025
    Copy the full SHA
    09b13c1 View commit details
  15. 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.
    jrfnl committed Jun 2, 2025
    Copy the full SHA
    986bb31 View commit details
  16. 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.
    jrfnl committed Jun 2, 2025
    Copy the full SHA
    6c70a6a View commit details
  17. WIP / not working yet - test workflow + GetVersionTest, rest should b…

    …e fine | Make PHPCS 4.x support official
    jrfnl committed Jun 2, 2025
    Copy the full SHA
    c8586f1 View 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