File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 33
44use Ubiquity \utils \base \UDateTime ;
55use Ubiquity \devtools \utils \arrays \ClassicArray ;
6+ use Ubiquity \utils \base \UString ;
67
78class ConsoleTable {
89
@@ -304,7 +305,7 @@ private function calculateColWidths() {
304305 if ($ col instanceof \DateTime) {
305306 $ col = UDateTime::elapsed ($ col );
306307 }
307- if (is_string ($ col )) {
308+ if (UString:: isValid ($ col )) {
308309 $ lines = explode ("\n" , $ col );
309310 $ size = sizeof ($ lines );
310311 if ($ size > $ this ->rowHeight [$ y ]) {
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ public function parse() {
1818 ]
1919 ];
2020 }
21+ if (! is_object ($ object )) {
22+ $ object = (object ) $ object ;
23+ }
2124 if (! is_array ($ this ->properties )) {
2225 $ this ->properties = $ this ->getProperties ($ object );
2326 }
@@ -48,15 +51,15 @@ public function parse() {
4851 }
4952
5053 private function parseValue ($ value ) {
51- $ result = " - " ;
52- if (is_array ($ value )) {
54+ $ result = ' - ' ;
55+ if (\ is_array ($ value )) {
5356 return $ this ->parseArray ($ value );
5457 } elseif (UString::isValid ($ value )) {
55- $ result = var_export ( $ value, true ) ;
56- } elseif (is_callable ($ value )) {
58+ $ result = $ value ;
59+ } elseif (\ is_callable ($ value )) {
5760 $ result = '(x)=>{} ' ;
5861 } else {
59- $ result = $ value ;
62+ $ result = \var_export ( $ value, true ) ;
6063 }
6164 return $ result ;
6265 }
You can’t perform that action at this time.
0 commit comments