Refactor names in CommandResolverInterface
This commit is contained in:
@ -51,6 +51,11 @@ class CommandBus implements CommandBusInterface
|
||||
$this->resolvers[] = $resolver;
|
||||
}
|
||||
|
||||
public function removeResolver(CommandResolverInterface $resolver): void
|
||||
{
|
||||
// FIXME implement
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the names of defined commands
|
||||
*
|
||||
@ -60,7 +65,7 @@ class CommandBus implements CommandBusInterface
|
||||
{
|
||||
$commands = [];
|
||||
foreach ($this->resolvers as $resolver) {
|
||||
$commands = array_merge($commands, $resolver->getNames());
|
||||
$commands = array_merge($commands, $resolver->getCommandNames());
|
||||
}
|
||||
sort($commands);
|
||||
return array_unique($commands);
|
||||
@ -75,7 +80,7 @@ class CommandBus implements CommandBusInterface
|
||||
public function findCommand(string $command): ?Command
|
||||
{
|
||||
foreach ($this->resolvers as $resolver) {
|
||||
if ($found = $resolver->find($command))
|
||||
if ($found = $resolver->findCommand($command))
|
||||
return $found;
|
||||
}
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user