22
33namespace Madewithlove \LaravelDebugConsole \Renderers ;
44
5- use Symfony \Component \Console \Helper \Table ;
6-
75class Query extends AbstractRenderer
86{
97 /**
@@ -18,27 +16,22 @@ public function render(array $data)
1816 array_get ($ data , 'queries.accumulated_duration_str ' )
1917 );
2018
21- $ this ->output ->title ('Queries ' );
22- $ this ->output ->writeln ($ message );
19+ $ this ->title ('Queries ' );
20+ $ this ->writeln ($ message );
21+ $ this ->newLine ();
2322
24- $ table = new Table ($ this ->output );
25- $ table
26- ->setHeaders ([
27- 'SQL ' ,
28- 'Duration ' ,
29- 'Statement ID ' ,
30- 'connection ' ,
31- ])
32- ->setRows (
33- $ queries ->map (function ($ query , $ index ) {
34- return [
35- array_get ($ query , 'sql ' ),
36- array_get ($ query , 'duration_str ' ),
37- array_get ($ query , 'stmt_id ' ),
38- str_limit (array_get ($ query , 'connection ' ), 20 ),
39- ];
40- })
41- ->all ())
42- ->render ();
23+ $ this ->table ([
24+ 'SQL ' ,
25+ 'Duration ' ,
26+ 'Statement ID ' ,
27+ 'connection ' ,
28+ ], $ queries ->map (function ($ query , $ index ) {
29+ return [
30+ array_get ($ query , 'sql ' ),
31+ array_get ($ query , 'duration_str ' ),
32+ array_get ($ query , 'stmt_id ' ),
33+ str_limit (array_get ($ query , 'connection ' ), 20 ),
34+ ];
35+ })->all ());
4336 }
4437}
0 commit comments