| Conditions | 3 |
| Paths | 2 |
| Total Lines | 22 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function handle(string $namespace, OutputInterface $output, $createNew = true) |
||
| 24 | { |
||
| 25 | $namespaceExp = explode('_', $namespace); |
||
| 26 | |||
| 27 | $isExists = $this->filesystem->exists($this->appContainer->get('app_dir') . '/app/code/' . $namespaceExp[0] . '/' . $namespaceExp[1]); |
||
| 28 | |||
| 29 | if (!$isExists && $createNew) { |
||
| 30 | /** @var Application $application */ |
||
| 31 | $application = $this->appContainer->resolve(Application::class); |
||
| 32 | $command = $application->find('module:create'); |
||
| 33 | |||
| 34 | $inputs = array( |
||
| 35 | 'namespace' => $namespace |
||
| 36 | ); |
||
| 37 | |||
| 38 | $greetInput = new ArrayInput($inputs); |
||
| 39 | $command->run($greetInput, $output); |
||
| 40 | |||
| 41 | return true; |
||
| 42 | } |
||
| 43 | |||
| 44 | return $isExists; |
||
| 45 | } |
||
| 47 |