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...
12
{
13
/**
14
* @var Generator
15
*/
16
protected $generator;
17
18
/**
19
* @param Generator $generator
20
*/
21
public function __construct(Generator $generator)
22
{
23
$this->generator = $generator;
24
}
25
26
public function onDispatch(MvcEvent $e)
27
{
28
if (!$e->getRequest() instanceof ConsoleRequest) {
29
throw new RuntimeException('You can only use this action from a console!');
30
}
31
32
$classPath = $this->generator->generate();
33
34
$response = sprintf("Generated skeleton class @ %s\n", realpath($classPath));
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.