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

[Php74] Add CurlyToSquareBracketArrayStringRector #858

Merged
merged 16 commits into from
Sep 11, 2021

Conversation

samsonasik
Copy link
Member

No description provided.

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@samsonasik
Copy link
Member Author

rebased.

public function refactor(Node $node): ArrayDimFetch
{
$node->setAttribute(AttributeKey::ORIGINAL_NODE, null);
return $node;
Copy link
Member

Choose a reason for hiding this comment

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

This will lead to reprint of every node regardless the feature is present

There should be some check to verify the syntax change is needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

any way to check that? because printing check first is always return square one.

Copy link
Member

Choose a reason for hiding this comment

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

That should not be hidden in the printer IMO.
Maybe using "kind" attribute as array has?

Check for the trailing comma rule, there is some logic with tokens too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

@samsonasik samsonasik Sep 11, 2021

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

Could you add comment to original node to null? Just so it's clear what is the goal of it

Copy link
Member Author

Choose a reason for hiding this comment

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

I added the comment e1e8472, the purpose is to re-draw the ArrayDimFetch to use [] bracket

Copy link
Member

Choose a reason for hiding this comment

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

Thank you

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I think it is ready.

@TomasVotruba TomasVotruba merged commit c71f6ee into main Sep 11, 2021
@TomasVotruba TomasVotruba deleted the add-curly-to-square branch September 11, 2021 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants