@@ -54,9 +54,9 @@ class CliDumper extends AbstractDumper
5454 /**
5555 * {@inheritdoc}
5656 */
57- public function __construct ($ output = null , $ charset = null )
57+ public function __construct ($ output = null , $ charset = null , $ flags = 0 )
5858 {
59- parent ::__construct ($ output , $ charset );
59+ parent ::__construct ($ output , $ charset, $ flags );
6060
6161 if ('\\' === DIRECTORY_SEPARATOR && false !== @getenv ('ANSICON ' )) {
6262 // Use only the base 16 xterm colors when using ANSICON
@@ -180,6 +180,9 @@ public function dumpString(Cursor $cursor, $str, $bin, $cut)
180180 $ m = count ($ str ) - 1 ;
181181 $ i = $ lineCut = 0 ;
182182
183+ if ($ this ->flags & self ::DUMP_STRING_LENGTH ) {
184+ $ this ->line .= '( ' .$ attr ['length ' ].') ' ;
185+ }
183186 if ($ bin ) {
184187 $ this ->line .= 'b ' ;
185188 }
@@ -249,7 +252,7 @@ public function enterHash(Cursor $cursor, $type, $class, $hasChild)
249252 } elseif (Cursor::HASH_RESOURCE === $ type ) {
250253 $ prefix = $ this ->style ('note ' , $ class .' resource ' ).($ hasChild ? ' { ' : ' ' );
251254 } else {
252- $ prefix = $ class ? $ this ->style ('note ' , 'array: ' .$ class ).' [ ' : '[ ' ;
255+ $ prefix = $ class && !( $ this -> flags & self :: DUMP_LIGHT_ARRAY ) ? $ this ->style ('note ' , 'array: ' .$ class ).' [ ' : '[ ' ;
253256 }
254257
255258 if ($ cursor ->softRefCount || 0 < $ cursor ->softRefHandle ) {
@@ -314,6 +317,9 @@ protected function dumpKey(Cursor $cursor)
314317 switch ($ cursor ->hashType ) {
315318 default :
316319 case Cursor::HASH_INDEXED :
320+ if ($ this ->flags & self ::DUMP_LIGHT_ARRAY ) {
321+ break ;
322+ }
317323 $ style = 'index ' ;
318324 case Cursor::HASH_ASSOC :
319325 if (is_int ($ key )) {
0 commit comments