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

Huge arrays are super slow to scan with Squiz.Arrays.ArrayDeclaration sniff #1681

Closed
dawehner opened this issue Sep 30, 2017 · 1 comment
Closed
Milestone

Comments

@dawehner
Copy link

We recently had a file where scanning a single file takes > 40s

RectangleTest.php.txt

We've made some analysis why this was done https://www.drupal.org/node/2911280#comment-12270785

I'm wondering whether it would be possible to fix this in phpcs itself? For now we have a custom fix which involves moves the data to a json file.

@gsherwood gsherwood added this to the 3.1.1 milestone Oct 5, 2017
@gsherwood gsherwood changed the title Huge arrays are super slow to scan Huge arrays are super slow to scan with Squiz.Arrays.ArrayDeclaration sniff Oct 5, 2017
gsherwood added a commit that referenced this issue Oct 5, 2017
@gsherwood
Copy link
Member

Thanks for reporting this. The code looking to see if the array was contained within parenthesis didn't need to be there because all tokens already have that information populated for them. All tests are still passing, so I think it's a good fix.

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

No branches or pull requests

2 participants