Skip to content

misc cleanup - #8793

Merged
TomasVotruba merged 5 commits into
mainfrom
tv-traverse-scope-3
Oct 26, 2026
Merged

TomasVotruba merged 5 commits into
mainfrom
tv-traverse-scope-3

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member
  • [perf] avoid checking instanceof stmt
  • no need for first class callable
  • tidy
  • cleanup unused code
  • remove deprecated and unused UseNodesToAddCollector

@TomasVotruba TomasVotruba changed the title tv traverse scope 3 misc cleanup Oct 26, 2026
@TomasVotruba
TomasVotruba merged commit 1a281e3 into main Oct 26, 2026
48 of 49 checks passed
@TomasVotruba
TomasVotruba deleted the tv-traverse-scope-3 branch October 26, 2026 08:15
samsonasik pushed a commit that referenced this pull request Nov 5, 2026
…ateMethodParameterRector (#8923)

* [NodeTypeResolver] Set scope on the class name of a first-class callable

processCallLike() returned early for every first-class callable, which
left the class name of self::method(...) and static::method(...) without
a scope. NameTypeResolver needs that scope to resolve self and static, so
it returned an ObjectType for a class literally named "self" or "static".

RemoveUnusedPrivateMethodParameterRector could then not match the callable
to its class, missed the isFirstClassCallable() guard and removed a
parameter from a method whose arity the receiving code controls.

The early return only has to protect getArgs(), so it moves back below the
scope assignments, where it was before #8793.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [DeadCode] Skip private method used as array callable on removing unused parameter

The code receiving [self::class, 'method'], [static::class, 'method'] or
[$this, 'method'] decides how many arguments it passes, the same as with a
first-class callable. PrivateMethodParamRemover never looked at arrays, so
it removed the parameter.

It now keeps the parameter when an array in the class names the method, or
when ArrayCallableMethodMatcher cannot tell which method the array names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants