use Table instead of the deprecated TableHelper
This commit is contained in:
parent
966ac2d066
commit
0bcb59414e
@ -304,27 +304,29 @@ class TextDescriptor extends Descriptor
|
|||||||
$registeredListeners = $eventDispatcher->getListeners($event);
|
$registeredListeners = $eventDispatcher->getListeners($event);
|
||||||
if (null !== $event) {
|
if (null !== $event) {
|
||||||
$this->writeText("\n");
|
$this->writeText("\n");
|
||||||
$table = new TableHelper();
|
$table = new Table($this->getOutput());
|
||||||
|
$table->getStyle()->setCellHeaderFormat('%s');
|
||||||
$table->setHeaders(array('Order', 'Callable'));
|
$table->setHeaders(array('Order', 'Callable'));
|
||||||
|
|
||||||
foreach ($registeredListeners as $order => $listener) {
|
foreach ($registeredListeners as $order => $listener) {
|
||||||
$table->addRow(array(sprintf('#%d', $order + 1), $this->formatCallable($listener)));
|
$table->addRow(array(sprintf('#%d', $order + 1), $this->formatCallable($listener)));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->renderTable($table);
|
$this->renderTable($table, true);
|
||||||
} else {
|
} else {
|
||||||
ksort($registeredListeners);
|
ksort($registeredListeners);
|
||||||
foreach ($registeredListeners as $eventListened => $eventListeners) {
|
foreach ($registeredListeners as $eventListened => $eventListeners) {
|
||||||
$this->writeText(sprintf("\n<info>[Event]</info> %s\n", $eventListened), $options);
|
$this->writeText(sprintf("\n<info>[Event]</info> %s\n", $eventListened), $options);
|
||||||
|
|
||||||
$table = new TableHelper();
|
$table = new Table($this->getOutput());
|
||||||
|
$table->getStyle()->setCellHeaderFormat('%s');
|
||||||
$table->setHeaders(array('Order', 'Callable'));
|
$table->setHeaders(array('Order', 'Callable'));
|
||||||
|
|
||||||
foreach ($eventListeners as $order => $eventListener) {
|
foreach ($eventListeners as $order => $eventListener) {
|
||||||
$table->addRow(array(sprintf('#%d', $order + 1), $this->formatCallable($eventListener)));
|
$table->addRow(array(sprintf('#%d', $order + 1), $this->formatCallable($eventListener)));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->renderTable($table);
|
$this->renderTable($table, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user