-
Notifications
You must be signed in to change notification settings - Fork 159
AbstractApiSniff creates infinite loop if class docblock is missing #160
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
Comments
Example class (this is the class it is crashing on in my case):
|
What seems to be happening under the hood, on line 50 AbstractApiSniff is searching for a previous doc comment open tag, which is missing (see example class). Instead of exiting there and providing the user with a warning/error/failure about a missing docblock, it goes into the for loop with values that are either NULL or FALSE, which seems to cause an infinite loop. I didn't debug it much further to be honest, but I felt it was necessary to at least report it in an issue so somebody else can pick it up further. I am/would also not be entirely sure what to do in terms of making a docblock a required part of such a class, that would be up to whoever determines what should be a part of the coding standards. |
@Wesdesignz could you please provide version of the coding standard you are using. |
magento/magento-coding-standard:1.0.2 |
It seems I'm about 5 major versions behind, but composer is not letting me update the package at this time... |
|
Happy to hear that. I assume we can close this ticket? |
Develop to Master version 18
Preconditions
Confirmed on:
Might reproduce on other versions as well, unconfirmed.
Steps to reproduce
phpcs --standard=Magento2 -vvv <file>
Expected result
Actual result
Last lines of output with -vvv:
The text was updated successfully, but these errors were encountered: