File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed
src/Symfony/Component/Console/Style Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change 17
17
use Symfony \Component \Console \Helper \ProgressBar ;
18
18
use Symfony \Component \Console \Helper \SymfonyQuestionHelper ;
19
19
use Symfony \Component \Console \Helper \Table ;
20
- use Symfony \Component \Console \Helper \TableCell ;
21
20
use Symfony \Component \Console \Input \InputInterface ;
22
21
use Symfony \Component \Console \Output \BufferedOutput ;
23
22
use Symfony \Component \Console \Output \OutputInterface ;
@@ -218,21 +217,13 @@ public function caution($message)
218
217
*/
219
218
public function table (array $ headers , array $ rows )
220
219
{
221
- array_walk_recursive ($ headers , function (&$ value ) {
222
- if ($ value instanceof TableCell) {
223
- $ value = new TableCell (sprintf ('<info>%s</> ' , $ value ), array (
224
- 'colspan ' => $ value ->getColspan (),
225
- 'rowspan ' => $ value ->getRowspan (),
226
- ));
227
- } else {
228
- $ value = sprintf ('<info>%s</> ' , $ value );
229
- }
230
- });
220
+ $ style = clone Table::getStyleDefinition ('symfony-style-guide ' );
221
+ $ style ->setCellHeaderFormat ('<info>%s</info> ' );
231
222
232
223
$ table = new Table ($ this );
233
224
$ table ->setHeaders ($ headers );
234
225
$ table ->setRows ($ rows );
235
- $ table ->setStyle (' symfony- style-guide ' );
226
+ $ table ->setStyle ($ style );
236
227
237
228
$ table ->render ();
238
229
$ this ->newLine ();
You can’t perform that action at this time.
0 commit comments