Problem/Motivation

Let's fix all PHPStan Lvl 1 errors Anonymous function has an unused use $foo.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3326371

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Spokje created an issue. See original summary.

spokje’s picture

Title: Fix PHPStan L2 error "Anonymous function has an unused use $foo. " » Fix PHPStan L1 error "Anonymous function has an unused use $foo. "
spokje’s picture

Title: Fix PHPStan L1 error "Anonymous function has an unused use $foo. " » Fix PHPStan L1 error "Anonymous function has an unused use $foo."
spokje’s picture

Status: Active » Needs review
mondrake’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, thanks.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 1a63aa6 and pushed to 10.1.x. Thanks!

  • alexpott committed 1a63aa63 on 10.1.x
    Issue #3326371 by Spokje: Fix PHPStan L1 error "Anonymous function has...

spokje’s picture

Do we want to backport this to 10.0.x?

It's a test/PHPStan-only change and will keep both branches more aligned.

mondrake’s picture

+1 for a backport to 10.0.x

spokje’s picture

Version: 10.1.x-dev » 10.0.x-dev
Status: Fixed » Needs review
StatusFileSize
new10.03 KB

Adding a 10.0.x patch

spokje’s picture

Title: Fix PHPStan L1 error "Anonymous function has an unused use $foo." » [10.0.x backport] Fix PHPStan L1 error "Anonymous function has an unused use $foo."
mondrake’s picture

Status: Needs review » Reviewed & tested by the community

Thanks

xjm’s picture

Status: Reviewed & tested by the community » Needs work

Does not apply to 10.0.x currently.

spokje’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new5.58 KB
new10.15 KB

Can I RTBC a reroll I did myself? Let's find out :)

xjm’s picture

Attempting to commit locally now. I'll let you know in an hour if that edgecase perf improvement was as promised...

  • xjm committed b6b21bda on 10.0.x
    Issue #3326371 by Spokje: [10.0.x backport] Fix PHPStan L1 error "...
xjm’s picture

Status: Reviewed & tested by the community » Fixed

Why yes, yes it does! 4 mins instead of 80.

spokje’s picture

Same down here, about 1/3 off the time when creating a complete new baseline, higher when having a primed cache and only a few files have changed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.