Skip to content

Improve exception renderers#422

Merged
mvorisek merged 21 commits intodevelopfrom
ex_render_improve
Feb 9, 2025
Merged

Improve exception renderers#422
mvorisek merged 21 commits intodevelopfrom
ex_render_improve

Conversation

@mvorisek
Copy link
Copy Markdown
Member

@mvorisek mvorisek commented Feb 9, 2025

improve #421

@mvorisek mvorisek changed the title Improve exception render Improve exception renderers Feb 9, 2025
@mvorisek mvorisek merged commit fe0073c into develop Feb 9, 2025
31 checks passed
@mvorisek mvorisek deleted the ex_render_improve branch February 9, 2025 12:58

private function optimizeText(string $value): string
{
$res = preg_replace("~\e\\[\\d{1,2}m\e\\[0m~", '', $value);
Copy link
Copy Markdown
Member

@DarkSide666 DarkSide666 Feb 10, 2025

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 ...

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) {
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants