Skip to content

Commit

Permalink
BlueScreen: unified listing of hidden keys [Closes #441]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Oct 14, 2020
1 parent 5e93a55 commit 3a7cfd5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Tracy/BlueScreen/BlueScreen.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public function getDumper(): \Closure

return function ($v, $k = null) use ($keysToHide): string {
if (is_string($k) && isset($keysToHide[strtolower($k)])) {
$v = Dumper::HIDDEN_VALUE;
return '<pre class="tracy-dump">' . Helpers::escapeHtml(Dumper::hideValue($v)) . '</pre>';
}
return Dumper::toHtml($v, [
Dumper::DEPTH => $this->maxDepth,
Expand Down
3 changes: 2 additions & 1 deletion src/Tracy/Dumper/Dumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,8 @@ private static function exportPhpIncompleteClass(\__PHP_Incomplete_Class $obj):
}


private static function hideValue($var): string
/** @internal */
public static function hideValue($var): string
{
return self::HIDDEN_VALUE . ' (' . (is_object($var) ? Helpers::getClass($var) : gettype($var)) . ')';
}
Expand Down
8 changes: 2 additions & 6 deletions tests/Tracy/expected/Debugger.error-in-eval.expect
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@
<tr><th>$user</th><td><pre class="tracy-dump"><span class="tracy-dump-string">"root"</span> (4)
</pre>
</td></tr>
<tr><th>$pass</th><td><pre class="tracy-dump"><span class="tracy-dump-string">"*****"</span> (5)
</pre>
</td></tr>
<tr><th>$pass</th><td><pre class="tracy-dump">***** (string)</pre></td></tr>
</table>
</div>
</li>
Expand All @@ -110,9 +108,7 @@
<tr><th>$user</th><td><pre class="tracy-dump"><span class="tracy-dump-string">"root"</span> (4)
</pre>
</td></tr>
<tr><th>$pass</th><td><pre class="tracy-dump"><span class="tracy-dump-string">"*****"</span> (5)
</pre>
</td></tr>
<tr><th>$pass</th><td><pre class="tracy-dump">***** (string)</pre></td></tr>
</table>
</div>
</div></div>
Expand Down

0 comments on commit 3a7cfd5

Please sign in to comment.