Skip to content

Support StaticMethodParameterClosureTypeExtension for New_ expressions#4819

Merged
ondrejmirtes merged 1 commit intophpstan:2.1.xfrom
ruudk:support-new-static-method-parameter-closure-type-extension
Jan 25, 2026
Merged

Support StaticMethodParameterClosureTypeExtension for New_ expressions#4819
ondrejmirtes merged 1 commit intophpstan:2.1.xfrom
ruudk:support-new-static-method-parameter-closure-type-extension

Conversation

@ruudk
Copy link
Contributor

@ruudk ruudk commented Jan 25, 2026

See phpstan/phpstan#14014 (comment)

Decided to add support to the current extensions to make it easier to merge this instead of proposing the change to:

/cc @ondrejmirtes @calebdw

@ruudk
Copy link
Contributor Author

ruudk commented Jan 25, 2026

It seems these failures are not related to this PR but coming from the main branch.

@ondrejmirtes ondrejmirtes merged commit b056b7f into phpstan:2.1.x Jan 25, 2026
628 of 640 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

$staticCall = new StaticCall(
$callLike->class,
new Identifier('__construct'),
$callLike->getArgs(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use NodeScopeResolver in rector, I think getArgs() should be replaced with args here, or check isFirstClassCallable() early here to avoid error assert error, see:

https://github.com/nikic/PHP-Parser/blob/8c360e27327c8bd29e1c57721574709d0d706118/lib/PhpParser/Node/Expr/CallLike.php#L32

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$callLike here cannot be a first class callable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments