forked from hechoendrupal/drupal-console
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerDebugCommand.php
More file actions
39 lines (34 loc) · 1.13 KB
/
Copy pathContainerDebugCommand.php
File metadata and controls
39 lines (34 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* @file
* Contains \Drupal\AppConsole\Command\ContainerDebugCommand.
*/
namespace Drupal\AppConsole\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class ContainerDebugCommand extends ContainerAwareCommand
{
protected function configure()
{
$this
->setName('container:debug')
->setDescription($this->trans('commands.container.debug.description'));
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$services = $this->getServices();
$table = $this->getHelperSet()->get('table');
$table->setHeaders(
[
$this->trans('commands.container.debug.messages.service_id'),
$this->trans('commands.container.debug.messages.class_name')
]);
$table->setlayout($table::LAYOUT_COMPACT);
foreach ($services as $serviceId) {
$service = $this->getContainer()->get($serviceId);
$class = get_class($service);
$table->addRow([$serviceId, $class]);
}
$table->render($output);
}
}