File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ static public function length($string) {
185185 $ test_string = self ::decolorize ($ string );
186186 }
187187
188- return safe_strlen ($ test_string );
188+ return strwidth ($ test_string );
189189 }
190190
191191 /**
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ public function setRenderer(Renderer $renderer) {
102102 */
103103 protected function checkRow (array $ row ) {
104104 foreach ($ row as $ column => $ str ) {
105- $ width = Colors::shouldColorize () ? Colors::length ($ str ) : safe_strlen ($ str );
105+ $ width = Colors::shouldColorize () ? Colors::length ($ str ) : strwidth ($ str );
106106 if (!isset ($ this ->_width [$ column ]) || $ width > $ this ->_width [$ column ]) {
107107 $ this ->_width [$ column ] = $ width ;
108108 }
Original file line number Diff line number Diff line change @@ -133,14 +133,14 @@ public function row( array $row ) {
133133 $ value = str_replace ( PHP_EOL , ' ' , $ value );
134134
135135 $ col_width = $ this ->_widths [ $ col ];
136- $ original_val_width = Colors::shouldColorize () ? Colors::length ( $ value ) : \cli \safe_strlen ( $ value );
136+ $ original_val_width = Colors::shouldColorize () ? Colors::length ( $ value ) : \cli \strwidth ( $ value );
137137 if ( $ original_val_width > $ col_width ) {
138138 $ row [ $ col ] = \cli \safe_substr ( $ value , 0 , $ col_width );
139139 $ value = \cli \safe_substr ( $ value , $ col_width , $ original_val_width );
140140 $ i = 0 ;
141141 do {
142142 $ extra_value = \cli \safe_substr ( $ value , 0 , $ col_width );
143- $ val_width = \cli \safe_strlen ( $ extra_value );
143+ $ val_width = \cli \strwidth ( $ extra_value );
144144 if ( $ val_width ) {
145145 $ extra_rows [ $ col ][] = $ extra_value ;
146146 $ value = \cli \safe_substr ( $ value , $ col_width , $ original_val_width );
You can’t perform that action at this time.
0 commit comments