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

Add rector rule to remove ray calls from a codebase #884

Merged
merged 11 commits into from
Jan 24, 2024
Merged

Conversation

timvandijck
Copy link
Member

2 ways of using it:

  1. In your own Rector config, by adding the RemoveRayCallRector rule.
  2. By using the package Rector config: ./vendor/bin/remove-ray.sh <path>

Copy link
Member

@sebastiandedeyne sebastiandedeyne left a comment

Choose a reason for hiding this comment

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

Does this also work for chained calls? Like ray()->clearScreen() and ray('Hello')->red()?

docs/advanced-usage/automatically-remove-ray-calls.md Outdated Show resolved Hide resolved
remove-ray-rector.php Outdated Show resolved Hide resolved
src/Rector/RemoveRayCallRector.php Outdated Show resolved Hide resolved
@Plytas
Copy link

Plytas commented Jan 10, 2024

And does it also work on macros like collect()->ray()?

@timvandijck
Copy link
Member Author

Does this also work for chained calls? Like ray()->clearScreen() and ray('Hello')->red()?

And does it also work on macros like collect()->ray()?

Now it should!

@timvandijck timvandijck merged commit 2ed3567 into main Jan 24, 2024
@Nielsvanpach Nielsvanpach deleted the rector branch January 24, 2024 15:30
@Plytas
Copy link

Plytas commented Jan 26, 2024

@timvandijck It doesn't seem to remove collection macro ray() call.
image

@timvandijck
Copy link
Member Author

@Plytas good spot, it seems like it's not working when a macro line is not ending with ->ray() but with an other method.

I created an issue to track this, probably will be resolved next week: #889

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