-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Refactor BacktraceIgnoreMatcher
#304
Conversation
vjik
commented
Jan 19, 2025
Q | A |
---|---|
Is bugfix? | ❌ |
New feature? | ❌ |
Breaks BC? | ✔️ |
@@ -105,8 +105,8 @@ public static function unregister(): void | |||
private function isIgnored(): bool | |||
{ | |||
$backtrace = debug_backtrace(); | |||
return BacktraceIgnoreMatcher::isIgnoredByClass($backtrace, self::$ignoredClasses) | |||
|| BacktraceIgnoreMatcher::isIgnoredByFile($backtrace, self::$ignoredPathPatterns); | |||
return BacktraceMatcher::byClass($backtrace[3], self::$ignoredClasses) |
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.
What could either byClass
or byFile
method mean?
Can't see any improvements here
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.
Backtrace match (class name) by file/class (method name).
"Ignore" doesn't matter here.
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.
- if you rename a class rename it instead of removing and adding a new one
- a class method must be a verb
- better name for the methods should contain
contains
/includes
/intersects
'cause it contains searching operation - the matcher now depends on the proxy implementation, which was independent before and could be used in any other flows
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.
- if you rename a class rename it instead of removing and adding a new one
That is what GitHub decided, not me :)
- a class method must be a verb
- better name for the methods should contain
contains
/includes
/intersects
'cause it contains searching operation
I don't think it makes sense in this case, because all methods perform single action. But it doesn't matter to me. Is "matchByFile()“ OK?
- the matcher now depends on the proxy implementation, which was independent before and could be used in any other flows
On the contrary, now the matcher could be used in any other flows, because it not depends from internal structure of calling class (It depends on which item of backtrace to use for matching).
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.
Methods are renamed.
3384c86
to
9ccf813
Compare