| Total Complexity | 4 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class PolicyMakeCommand extends GeneratorCommand |
||
| 10 | { |
||
| 11 | use ModuleCommands; |
||
| 12 | |||
| 13 | /** @var string */ |
||
| 14 | protected $argumentName = 'name'; |
||
| 15 | |||
| 16 | /** @var string */ |
||
| 17 | protected $signature = 'module:make-policy |
||
| 18 | {name : The name of the policy class} |
||
| 19 | {module? : The name of the module to create the policy for}'; |
||
| 20 | |||
| 21 | /** @var string */ |
||
| 22 | protected $description = 'Create a new policy class for the specified module.'; |
||
| 23 | |||
| 24 | protected function getDefaultNamespace(): string |
||
| 25 | { |
||
| 26 | /** @var \Rawilk\LaravelModules\Contracts\Repository $module */ |
||
| 27 | $module = $this->laravel['modules']; |
||
| 28 | |||
| 29 | return $module->config('paths.generator.policies.namespace') ?: $module->config('paths.generator.policies.path', 'Policies'); |
||
| 30 | } |
||
| 31 | |||
| 32 | protected function getDestinationFilePath(): string |
||
| 39 | } |
||
| 40 | |||
| 41 | protected function getTemplateContents(): string |
||
| 49 | } |
||
| 50 | } |
||
| 51 |