Sulu\Bundle\DocumentManagerBundle\Command\SubscriberDebugCommand::execute PHP Method

execute() public method

public execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    public function execute(InputInterface $input, OutputInterface $output)
    {
        $eventName = $input->getArgument('event_name');
        $dispatcher = $this->getContainer()->get('sulu_document_manager.event_dispatcher');
        if (!$eventName) {
            return $this->showEventNames($output);
        }
        $eventName = self::PREFIX . $eventName;
        $listeners = $dispatcher->getListeners($eventName);
        foreach ($listeners as $listenerTuple) {
            list($listener, $methodName) = $listenerTuple;
            $refl = new \ReflectionClass(get_class($listener));
            $priority = $this->getPriority($eventName, $methodName, $listener);
            $rows[] = [sprintf('<comment>%s</comment>\\%s', $refl->getNamespaceName(), $refl->getShortName()), $methodName, $priority];
        }
        usort($rows, function ($a, $b) {
            return $a[2] < $b[2];
        });
        $table = new Table($output);
        $table->setHeaders(['Class', 'Method', 'Priority']);
        $table->setRows($rows);
        $table->render();
    }