File tree Expand file tree Collapse file tree 3 files changed +35
-18
lines changed
Expand file tree Collapse file tree 3 files changed +35
-18
lines changed Original file line number Diff line number Diff line change 22
33namespace Madewithlove \LaravelDebugConsole \Renderers ;
44
5- class Messages extends AbstractRenderer
5+ class Message extends AbstractRenderer
66{
77 /**
88 * @param array $data
Original file line number Diff line number Diff line change 22
33namespace Madewithlove \LaravelDebugConsole \Renderers ;
44
5- use Symfony \Component \Console \Helper \Table ;
6-
75class Request extends AbstractRenderer
86{
97 /**
108 * @param array $data
119 */
1210 public function render (array $ data )
1311 {
14- $ this ->output ->writeln ('Request information: ' );
12+ $ this ->output ->title ('Route ' );
13+
14+ $ request = array_get ($ data , 'request ' , []);
15+
16+ $ this ->output ->table ([], array_map (function ($ value , $ index ) {
17+ if (is_array ($ value )) {
18+ $ value = implode (', ' , $ value );
19+ }
1520
16- $ table = new Table ($ this ->output );
17- $ table ->setHeaders ([
18- 'Date and Time ' ,
19- 'Total Memory ' ,
20- 'Total Time ' ,
21- ])
22- ->setRows ([
23- [
24- array_get ($ data , '__meta.datetime ' ),
25- array_get ($ data , 'memory.peak_usage_str ' ),
26- array_get ($ data , 'time.duration_str ' )
27- ],
28- ])
29- ->render ();
21+ return [$ index , str_limit ($ value , 200 )];
22+ }, array_values ($ request ), array_keys ($ request )));
3023 }
3124}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Madewithlove \LaravelDebugConsole \Renderers ;
4+
5+ class Route extends AbstractRenderer
6+ {
7+ /**
8+ * @param array $data
9+ */
10+ public function render (array $ data )
11+ {
12+ $ this ->output ->title ('Route ' );
13+
14+ $ route = array_get ($ data , 'route ' , []);
15+
16+ $ this ->output ->table ([], array_map (function ($ value , $ index ) {
17+ if (is_array ($ value )) {
18+ $ value = implode (', ' , $ value );
19+ }
20+
21+ return [$ index , str_limit ($ value , 200 )];
22+ }, array_values ($ route ), array_keys ($ route )));
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments