Skip to content

AC-7098: Performance issue in TableNameSniff with big array #429

New issue

Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “No 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? No Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

victor-v-rad
Copy link
Collaborator

@victor-v-rad victor-v-rad commented Nov 30, 2022

Fix summary

The performance of TableNameSniff degradated with a big array and structure like this
$fooBar=array(0=>array(125,0,875,750),1 =>array(85,0,194,716), 2 => 100);
But TableNameSniff expected to process the associative array similar to
['main_table_name' => 'magento/sample_table']
in result, $phpcsFile->findPrevious could not find associate array key in $stackPtr -1

The fix is to make findPrevious to find any non whitespace token as array key

Related Pull Requests

https://github.com/magento-commerce/mray/pull/158

- updated rector/rector because its dependency phpstan/phpstan released 1.9 and caused build to fail
@victor-v-rad
Copy link
Collaborator Author

New version phpstan/phpstan (1.8.9 => 1.9.2) released and caused this build to fail.
image

In my last commit I updated rector/rector and its dependency phpstan/phpstan. Plus fixed related to this update failing tests Magento2/Rector/Tests/*

@victor-v-rad
Copy link
Collaborator Author

Closing this PR and recreated in internal https://github.com/magento-commerce/magento-coding-standard/pull/197

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

Successfully merging this pull request may close these issues.

1 participant