[COMMAND] Fix ListEvents command to properly display the callable
This commit is contained in:
parent
292c9dc862
commit
b71eded942
@ -69,9 +69,6 @@ EOF
|
|||||||
|
|
||||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||||
{
|
{
|
||||||
$io = new SymfonyStyle($input, $output);
|
|
||||||
|
|
||||||
$options = [];
|
|
||||||
$patterm = $input->getArgument('pattern') ?? 'GNUsocial.*';
|
$patterm = $input->getArgument('pattern') ?? 'GNUsocial.*';
|
||||||
$listeners = $this->dispatcher->getListeners();
|
$listeners = $this->dispatcher->getListeners();
|
||||||
$listeners = F\select($listeners,
|
$listeners = F\select($listeners,
|
||||||
@ -79,18 +76,24 @@ EOF
|
|||||||
return preg_match('/' . $patterm . '/', $key);
|
return preg_match('/' . $patterm . '/', $key);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
echo "\n";
|
||||||
foreach ($listeners as $event => $listener) {
|
foreach ($listeners as $event => $listener) {
|
||||||
echo "Event '{$event}' handled by:\n";
|
echo "Event '{$event}':\n";
|
||||||
foreach ($listener as $c) {
|
foreach ($listener as $c) {
|
||||||
$r = new ReflectionFunction($c);
|
$r = new ReflectionFunction($c);
|
||||||
echo ' ' . get_class($r->getStaticVariables()['handler'][0]) . "\n";
|
$m = $r->getStaticVariables()['handler'];
|
||||||
|
echo ' ' . get_class($m[0]) . '::' . $m[1] . "\n";
|
||||||
}
|
}
|
||||||
|
echo "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$input->hasArgument('pattern')) {
|
||||||
|
$io = new SymfonyStyle($input, $output);
|
||||||
|
$options = [];
|
||||||
$helper = new DescriptorHelper();
|
$helper = new DescriptorHelper();
|
||||||
$options['output'] = $io;
|
$options['output'] = $io;
|
||||||
$helper->describe($io, null, $options);
|
$helper->describe($io, null, $options);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user