This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
19
{
20
/**
21
* @var ContainerInterface
22
*/
23
private $container;
24
25
/**
26
* @var string[]
27
*/
28
private $command_handler_ids = [];
29
30
/**
31
* @param ContainerInterface $container
32
*/
33
public function __construct(ContainerInterface $container)
34
{
35
$this->container = $container;
36
}
37
38
/**
39
* @param Command $command
40
*
41
* @return CommandHandler|null
42
*/
43
public function getCommandHandler(Command $command)
44
{
45
return $this->lazyLoad(get_class($command));
46
}
47
48
/**
49
* @param string $command_name
50
* @param string $service
51
*/
52
public function registerService($command_name, $service)
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.