Skip to content

Fix ImportsFromTestNamespace from lock on group use with trailing comma #220

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

Merged
merged 2 commits into from
Aug 24, 2021

Conversation

fsw
Copy link
Member

@fsw fsw commented Aug 20, 2021

If a grouped use statement has a trailing coma like this:

use Magento\Something{
  Foo,
  Bar,
};

findNext on line 59 was returning false and next call was starting to search again from line 1 ($next + 1) and this function was looping indefinitely through input tokens.

…laration has trailing coma.

If a grouped use statement has a trailing coma like this:
```
use Magento\Something{
  Foo,
  Bar,
};
```
`findNext` on line 59 was returning false and next call was starting to search again from line 1 (`$next + 1`) and this function was looping indefinitely through input tokens.
@sivaschenko
Copy link
Member

@fsw can you please cover this case with a test?

@fsw
Copy link
Member Author

fsw commented Aug 20, 2021

@sivaschenko done. I have modified existing test case. Without the fix it hangs, with the fix it passes.

@sivaschenko
Copy link
Member

@magento import pr to magento-commerce/magento-coding-standard

@magento-engcom-team
Copy link
Contributor

@sivaschenko the pull request successfully imported.

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

Successfully merging this pull request may close these issues.

4 participants