Skip to content

Commit

Permalink
fix: Fix web profiler HTML.
Browse files Browse the repository at this point in the history
  • Loading branch information
priyadi committed Feb 6, 2024
1 parent 4023f15 commit 44c756b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Full documentation is available at [rekalogika.dev/mapper](https://rekalogika.de

* Option to read & write to private properties.
* Data collector and profiler integration.
* Lazy-loading proxy for target objects.
* Cache eviction if involved classes change in debug mode.

## Installation

Expand Down
8 changes: 4 additions & 4 deletions src/Util/TypeUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public static function getTypeStringHtml(Type|MixedType $type): string
} else {
$shortClassName = preg_replace('/^.*\\\\/', '', $typeString) ?? $typeString;
$typeString = sprintf(
'<abbr title="%s">%s</a>',
'<abbr title="%s">%s</abbr>',
\htmlspecialchars($typeString),
\htmlspecialchars($shortClassName)
);
Expand All @@ -337,7 +337,7 @@ public static function getTypeStringHtml(Type|MixedType $type): string
if ($keyTypes) {
$keyTypesString = [];
foreach ($keyTypes as $keyType) {
$keyTypesString[] = self::getTypeString($keyType);
$keyTypesString[] = self::getTypeStringHtml($keyType);
}
$keyTypesString = implode('|', $keyTypesString);
} else {
Expand All @@ -349,14 +349,14 @@ public static function getTypeStringHtml(Type|MixedType $type): string
if ($valueTypes) {
$valueTypesString = [];
foreach ($valueTypes as $valueType) {
$valueTypesString[] = self::getTypeString($valueType);
$valueTypesString[] = self::getTypeStringHtml($valueType);
}
$valueTypesString = implode('|', $valueTypesString);
} else {
$valueTypesString = 'mixed';
}

$typeString .= sprintf('<%s,%s>', $keyTypesString, $valueTypesString);
$typeString .= sprintf('&lt;%s,%s&gt;', $keyTypesString, $valueTypesString);
}

return $typeString;
Expand Down
8 changes: 5 additions & 3 deletions templates/data_collector.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@
{% macro render_row(tracedata, depth) %}
<tr>
<td>
{% if depth > 0 %}
{% for i in 1..depth %}&nbsp;&nbsp;{% endfor %}{{ tracedata.path ?? '(root)' }}
{% if depth > 1 %}
{% for i in 1..depth-1 %}&nbsp;{% endfor %}└{{ tracedata.path ?? '(root)' }}
{% else if depth == 1 %}
└{{ tracedata.path ?? '(???)' }}
{% else %}
{{ tracedata.path ?? '(root)' }}
{{ tracedata.path ?? '(???)' }}
{% endif %}
</td>
<td>{{ tracedata.sourceType|abbr_class }}</td>
Expand Down

0 comments on commit 44c756b

Please sign in to comment.