@@ -297,10 +297,13 @@ private function dumpArray(&$var, array $options, int $level): string
297
297
$ out = $ span . '> ' . $ out . count ($ var ) . ")</span> \n" . '<div ' . ($ collapsed ? ' class="tracy-collapsed" ' : '' ) . '> ' ;
298
298
$ options ['parents ' ][] = $ var ;
299
299
foreach ($ var as $ k => &$ v ) {
300
- $ hide = is_string ($ k ) && isset ($ this ->keysToHide [strtolower ($ k )]) ? self :: HIDDEN_VALUE : null ;
300
+ $ hide = is_string ($ k ) && isset ($ this ->keysToHide [strtolower ($ k )]);
301
301
$ out .= '<span class="tracy-dump-indent"> ' . str_repeat ('| ' , $ level ) . '</span> '
302
302
. '<span class="tracy-dump-key"> ' . Helpers::escapeHtml ($ this ->encodeKey ($ k )) . '</span> => '
303
- . ($ hide ? $ this ->dumpString ($ hide ) : $ this ->dumpVar ($ v , $ options , $ level + 1 ));
303
+ . ($ hide
304
+ ? Helpers::escapeHtml (self ::hideValue ($ v )) . "\n"
305
+ : $ this ->dumpVar ($ v , $ options , $ level + 1 )
306
+ );
304
307
}
305
308
array_pop ($ options ['parents ' ]);
306
309
@@ -361,10 +364,13 @@ private function dumpObject(&$var, array $options, int $level): string
361
364
$ vis = ' <span class="tracy-dump-visibility"> ' . ($ k [1 ] === '* ' ? 'protected ' : 'private ' ) . '</span> ' ;
362
365
$ k = substr ($ k , strrpos ($ k , "\x00" ) + 1 );
363
366
}
364
- $ hide = is_string ($ k ) && isset ($ this ->keysToHide [strtolower ($ k )]) ? self :: HIDDEN_VALUE : null ;
367
+ $ hide = is_string ($ k ) && isset ($ this ->keysToHide [strtolower ($ k )]);
365
368
$ out .= '<span class="tracy-dump-indent"> ' . str_repeat ('| ' , $ level ) . '</span> '
366
369
. '<span class="tracy-dump-key"> ' . Helpers::escapeHtml ($ this ->encodeKey ($ k )) . "</span> $ vis => "
367
- . ($ hide ? $ this ->dumpString ($ hide ) : $ this ->dumpVar ($ v , $ options , $ level + 1 ));
370
+ . ($ hide
371
+ ? Helpers::escapeHtml (self ::hideValue ($ v )) . "\n"
372
+ : $ this ->dumpVar ($ v , $ options , $ level + 1 )
373
+ );
368
374
}
369
375
array_pop ($ options ['parents ' ]);
370
376
@@ -419,7 +425,7 @@ private function toJson(&$var, array $options = [], int $level = 0)
419
425
$ options ['parents ' ][] = $ var ;
420
426
foreach ($ var as $ k => &$ v ) {
421
427
$ hide = is_string ($ k ) && isset ($ this ->keysToHide [strtolower ($ k )]);
422
- $ res [] = [$ this ->encodeKey ($ k ), $ hide ? self ::HIDDEN_VALUE : $ this ->toJson ($ v , $ options , $ level + 1 )];
428
+ $ res [] = [$ this ->encodeKey ($ k ), $ hide ? [ ' type ' => self ::hideValue ( $ v )] : $ this ->toJson ($ v , $ options , $ level + 1 )];
423
429
}
424
430
array_pop ($ options ['parents ' ]);
425
431
return $ res ;
@@ -456,7 +462,7 @@ private function toJson(&$var, array $options = [], int $level = 0)
456
462
$ k = substr ($ k , strrpos ($ k , "\x00" ) + 1 );
457
463
}
458
464
$ hide = is_string ($ k ) && isset ($ this ->keysToHide [strtolower ($ k )]);
459
- $ obj ['items ' ][] = [$ this ->encodeKey ($ k ), $ hide ? self ::HIDDEN_VALUE : $ this ->toJson ($ v , $ options , $ level + 1 ), $ vis ];
465
+ $ obj ['items ' ][] = [$ this ->encodeKey ($ k ), $ hide ? [ ' type ' => self ::hideValue ( $ v )] : $ this ->toJson ($ v , $ options , $ level + 1 ), $ vis ];
460
466
}
461
467
}
462
468
return ['object ' => $ obj ['id ' ]];
@@ -619,6 +625,12 @@ private static function exportPhpIncompleteClass(\__PHP_Incomplete_Class $obj):
619
625
}
620
626
621
627
628
+ private static function hideValue ($ var ): string
629
+ {
630
+ return self ::HIDDEN_VALUE . ' ( ' . (is_object ($ var ) ? Helpers::getClass ($ var ) : gettype ($ var )) . ') ' ;
631
+ }
632
+
633
+
622
634
/**
623
635
* Finds the location where dump was called. Returns [file, line, code]
624
636
*/
0 commit comments