Skip to content

Conversation

@calebdw
Copy link
Contributor

@calebdw calebdw commented Sep 14, 2025

Hello!

I tried running this rule on my codebase, and there was a lot of breaks so this fixes those.

Additionally, I refactored the rule to remove duplication, improve readability, and make it more consistent with other rules (like adding a shouldSkip() method).

Thanks!

@calebdw calebdw force-pushed the calebdw/push-wonpvszmkpyq branch 2 times, most recently from e72bd72 to 988488c Compare September 14, 2025 05:46
@calebdw calebdw force-pushed the calebdw/push-wonpvszmkpyq branch from 988488c to 6b8de93 Compare September 14, 2025 05:50
@TomasVotruba
Copy link
Member

Looks good, thank you 💪🏻

@TomasVotruba TomasVotruba merged commit ecc0cf7 into rectorphp:main Sep 14, 2025
49 checks passed
Scope $scope
): bool {
$params = $node->getParams();
$args = $callLike->getArgs();
Copy link
Member

Choose a reason for hiding this comment

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

this ->getArgs() can't be moved too early calls, as it will cause assert error when already first class callable, see

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

, check firstClassCallable() first.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll fix in a new PR

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