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

[Rector] Apply Rector: ChangeArrayPushToArrayAssignRector #4560

Conversation

samsonasik
Copy link
Member

Change array_push() to direct variable assign with ChangeArrayPushToArrayAssignRector rector rule.

Checklist:

  • Securely signed commits

@@ -200,7 +200,7 @@ public function getDestination(string $destination, string $delimiter = '_', int
{
$i = end($parts);
array_pop($parts);
array_push($parts, ++ $i);
$parts[] = ++ $i;
Copy link
Member

Choose a reason for hiding this comment

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

Do we have a rector rule that makes the increment/decrement operators close to their subjects?

- ++ $i;
- $j ++
+ ++$i
+ $j++

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems not yet for now.

@samsonasik samsonasik merged commit dd19b1e into codeigniter4:develop Apr 12, 2021
@samsonasik samsonasik deleted the apply-rector-change-array-push-to-array-assign branch April 12, 2021 14:05
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.

None yet

2 participants