-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Fixing constant indexer #2249
Fixing constant indexer #2249
Conversation
$record->setFilePath($document->uri()->path()); | ||
$index->write($record); | ||
$firstArgument = $expression; | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we just needed to add the break and the original code was ok? doing it like this means dealing with NULL and adding a temporary var on line 85. if we want to make the code "cleaner" we can extract a method, but I think just adding break
is enough 🙂
nice find! if you agree can you update the code as per the suggestion and update the CHANGELOG? 🙇 |
Yeah that implementation would be much easier. Fixed it now. |
5c93805
to
bf8f7df
Compare
bf8f7df
to
848e80f
Compare
Merci 🙇 |
Closes #2168
What was the problem?
The problem was that in the old code phpactor created a constant for every (string literal) argument in a define call. This isn't correct since the first argument in the call is the name and the second argument is the value of the constant. The multilineness of the value was what tricked the cache. But this isn't a problem since the second argument shouldn't be a constant in the first place.