Improve handling of prefix stripping for anonymous frames#1820
Merged
stayallive merged 3 commits intomasterfrom Apr 10, 2025
Merged
Improve handling of prefix stripping for anonymous frames#1820stayallive merged 3 commits intomasterfrom
stayallive merged 3 commits intomasterfrom
Conversation
06b1231 to
6b6437e
Compare
cleptric
approved these changes
Apr 8, 2025
|
|
||
| if (mb_substr($functionName, 0, mb_strlen(Frame::ANONYMOUS_CLASS_PREFIX)) === Frame::ANONYMOUS_CLASS_PREFIX) { | ||
| $functionName = Frame::ANONYMOUS_CLASS_PREFIX . $this->stripPrefixFromFilePath($this->options, substr($backtraceFrame['class'], \strlen(Frame::ANONYMOUS_CLASS_PREFIX))); | ||
| // Optimization: skip doing regex if we don't have prefixes to strip |
Member
There was a problem hiding this comment.
Suggested change
| // Optimization: skip doing regex if we don't have prefixes to strip | |
| // Skip if no prefixes are set |
stayallive
added a commit
that referenced
this pull request
Apr 10, 2025
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve handling of prefix stripping for anonymous frames. As reported in #1817 we did not handle the case where the class name is known opposed to being "class". Added a test and ensure we handle that case now. Also added a (micro) optimization to never even run the code if there is no benefit (no prefixes defined).
Fixes #1817