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

4.0 | File::isReference(): simplify code #43

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

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Nov 9, 2023

Description

Recreation of upstream PR squizlabs/PHP_CodeSniffer#3338:

Commit 08824f3 added support for T_USE tokens for closures being parentheses owners and PR squizlabs/PHP_CodeSniffer#3104 fixed this up for non-closure use.

As the File::getMethodParameters() method also supports closure use parameters already, the code in the File::isReference() method can now be simplified.

The existing unit tests already cover this.

Suggested changelog entry

N/A

@jrfnl jrfnl added this to the 4.0.0 milestone Nov 9, 2023
@jrfnl jrfnl changed the base branch from master to 4.0 November 9, 2023 13:51
@jrfnl jrfnl changed the title Phpcs 4.x/file isreference simplify 4.0 | File::isReference(): simplify code Nov 9, 2023
@jrfnl jrfnl force-pushed the phpcs-4.x/file-isreference-simplify branch from 448e8c5 to fd448c0 Compare November 11, 2023 04:09
@jrfnl jrfnl force-pushed the phpcs-4.x/file-isreference-simplify branch from fd448c0 to b32f418 Compare December 6, 2023 00:25
Commit 08824f3 added support for `T_USE` tokens for closures being parentheses owners.

As the `File::getMethodParameters()` method also supports closure `use` parameters already, the code in the `File::isReference()` method can now be simplified.

The existing unit tests already cover this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant