| Total Complexity | 5 |
| Total Lines | 62 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class MakeFormatterCommand extends GeneratorCommand |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | protected $name = 'make:formatter'; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | protected $description = 'Create the formatter class'; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var string |
||
| 24 | */ |
||
| 25 | protected $type = 'Formatter'; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Specify your Stub's location. |
||
| 29 | * |
||
| 30 | * @return string |
||
| 31 | */ |
||
| 32 | 1 | protected function getStub(): string |
|
| 33 | { |
||
| 34 | 1 | return $this->resolveStubPath('/stubs/formatter.stub'); |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Resolve the fully-qualified path to the stub. |
||
| 39 | * |
||
| 40 | * @param string $stub |
||
| 41 | * |
||
| 42 | * @return string |
||
| 43 | */ |
||
| 44 | 1 | protected function resolveStubPath(string $stub): string |
|
| 45 | { |
||
| 46 | 1 | return file_exists($customPath = $this->laravel->basePath(trim($stub, '/'))) |
|
| 47 | ? $customPath // @codeCoverageIgnore |
||
| 48 | 1 | : __DIR__ . $stub; |
|
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Get the default namespace for the class. |
||
| 53 | * |
||
| 54 | * @param string $rootNamespace |
||
| 55 | * |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | 1 | protected function getDefaultNamespace($rootNamespace): string |
|
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * Get the console command options. |
||
| 65 | * |
||
| 66 | * @return array |
||
| 67 | */ |
||
| 68 | 1 | protected function getOptions(): array |
|
| 72 | ]; |
||
| 73 | } |
||
| 74 | } |
||
| 75 |