-
Notifications
You must be signed in to change notification settings - Fork 14
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
Improve exception renderers #422
Conversation
b5ec9cb
to
907aa79
Compare
b4f8fcd
to
d413020
Compare
|
||
private function optimizeText(string $value): string | ||
{ | ||
$res = preg_replace("~\e\\[\\d{1,2}m\e\\[0m~", '', $value); |
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.
would be nice to add small comment here about what these regexes does
first removes empty sequences, but second ...
@@ -268,14 +268,12 @@ protected function makeRelativePath(string $path): string | |||
|
|||
protected function tryRelativizePathsInString(string $str): string | |||
{ | |||
$str = preg_replace_callback('~(?<!\w)(?:[/\\\]|[a-z]:)\w?+[^:"\',;]*?\.php(?!\w)~i', function ($matches) { | |||
return preg_replace_callback('~(?<!\w)(?:[/\\\]|[a-z]:)\w?+[^:"\',;]*?\.php(?!\w)~i', function ($matches) { |
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.
would be nice to add comment about what this regex does
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.
AFAIK, this is even untested (exact behaviour is unasserted), thus help welcomed. It is a little problematic as the repo can be part of another repo and the tests should still pass.
improve #421