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

FirstClassCallableRector should also change simple function names #8670

Closed
flack opened this issue Jun 10, 2024 · 2 comments
Closed

FirstClassCallableRector should also change simple function names #8670

flack opened this issue Jun 10, 2024 · 2 comments
Labels

Comments

@flack
Copy link

flack commented Jun 10, 2024

Feature Request

Currently, FirstClassCallableRector will transform this code:

-$result = array_map([$this, 'removeWhitespace'], $input);
+$result = array_map($this->removeWhitespace(...), $input);

It would be great if it could also transform this:

-$result = array_map('trim', $input);
+$result = array_map(trim(...), $input);
@samsonasik
Copy link
Member

implemented at rectorphp/rector-src#6027

@nikolicaleksa
Copy link

@flack Please be aware that with the next release of Rector you will explicitly need to enable the first-class-callable rule for functions. See this issue and this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants