Total Complexity | 2 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
17 | class ClassCommandMakerSubscriber implements \Saci\Console\Domain\Services\ClassCommandMakerSubscriber, EventSubscriberInterface |
||
18 | { |
||
19 | |||
20 | 2 | public function create(CommandWasCreated $commandWasCreated) |
|
21 | { |
||
22 | 2 | $classMaker = new CommandClassMaker($commandWasCreated->getCommand()); |
|
23 | 2 | $generateable = $classMaker->generate(new Command()); |
|
24 | 2 | $stringClass = GeneratorClassFactory::create()->generate($generateable); |
|
25 | |||
26 | 2 | $stringClass = "<?php\n" . $stringClass; |
|
27 | |||
28 | 2 | (new Filesystem())->dumpFile( |
|
29 | 2 | $commandWasCreated->getCommand()->getLocalFileCommand(), |
|
30 | 2 | $stringClass |
|
31 | ); |
||
32 | |||
33 | 2 | return true; |
|
34 | } |
||
35 | |||
36 | 2 | public static function getSubscribedEvents() |
|
39 | } |
||
40 | } |