File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change 18
18
use Symfony \Component \Console \Helper \ProgressBar ;
19
19
use Symfony \Component \Console \Helper \SymfonyQuestionHelper ;
20
20
use Symfony \Component \Console \Helper \Table ;
21
- use Symfony \Component \Console \Helper \TableCell ;
22
21
use Symfony \Component \Console \Input \InputInterface ;
23
22
use Symfony \Component \Console \Output \BufferedOutput ;
24
23
use Symfony \Component \Console \Output \OutputInterface ;
@@ -185,21 +184,13 @@ public function caution($message)
185
184
*/
186
185
public function table (array $ headers , array $ rows )
187
186
{
188
- array_walk_recursive ($ headers , function (&$ value ) {
189
- if ($ value instanceof TableCell) {
190
- $ value = new TableCell (sprintf ('<info>%s</> ' , $ value ), array (
191
- 'colspan ' => $ value ->getColspan (),
192
- 'rowspan ' => $ value ->getRowspan (),
193
- ));
194
- } else {
195
- $ value = sprintf ('<info>%s</> ' , $ value );
196
- }
197
- });
187
+ $ style = clone Table::getStyleDefinition ('symfony-style-guide ' );
188
+ $ style ->setCellHeaderFormat ('<info>%s</info> ' );
198
189
199
190
$ table = new Table ($ this );
200
191
$ table ->setHeaders ($ headers );
201
192
$ table ->setRows ($ rows );
202
- $ table ->setStyle (' symfony- style-guide ' );
193
+ $ table ->setStyle ($ style );
203
194
204
195
$ table ->render ();
205
196
$ this ->newLine ();
You can’t perform that action at this time.
0 commit comments