| Total Complexity | 7 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class Application extends ConsoleApplication |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * Home directory. |
||
| 18 | */ |
||
| 19 | protected ?string $home = null; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * {@inheritDoc} |
||
| 23 | */ |
||
| 24 | protected function getCommandName(InputInterface $input): string |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * {@inheritDoc} |
||
| 31 | */ |
||
| 32 | protected function getDefaultCommands(): array |
||
| 33 | { |
||
| 34 | $commands = parent::getDefaultCommands(); |
||
| 35 | $commands[] = new ExceptionGeneratorCommand(); |
||
| 36 | return $commands; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * {@inheritDoc} |
||
| 41 | */ |
||
| 42 | public function getDefinition(): InputDefinition |
||
| 43 | { |
||
| 44 | $inputDefinition = parent::getDefinition(); |
||
| 45 | // clear out the normal first argument, which is the command name |
||
| 46 | $inputDefinition->setArguments(); |
||
| 47 | return $inputDefinition; |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Get path to home directory. |
||
| 52 | */ |
||
| 53 | public function getHome(): ?string |
||
| 54 | { |
||
| 55 | if (null === $this->home) { |
||
| 56 | $this->home = getenv('HOME') ?: null; |
||
| 57 | } |
||
| 58 | |||
| 59 | return $this->home; |
||
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Set path to home directory. |
||
| 64 | */ |
||
| 65 | public function setHome(string $home): void |
||
| 68 | } |
||
| 69 | } |
||
| 70 |