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