Total Complexity | 5 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class MakeServiceCommand extends MakeFile |
||
9 | { |
||
10 | /** |
||
11 | * The name and signature of the console command. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $signature = 'make:service {name : The name of the service class with path too} {--m|model= : The model to attach to the service}'; |
||
16 | |||
17 | /** |
||
18 | * The console command description. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $description = 'This creates a service class for a specified model if supplied'; |
||
23 | |||
24 | public function getStub() |
||
25 | { |
||
26 | if ($this->hasArgument('name')) { |
||
27 | return __DIR__.'/stubs/FullService.stub'; |
||
28 | } else { |
||
29 | return __DIR__.'/stubs/PlainService.stub'; |
||
30 | } |
||
31 | } |
||
32 | |||
33 | public function getModel() |
||
34 | { |
||
35 | return $this->argument('model'); |
||
36 | } |
||
37 | |||
38 | public function getFilename() |
||
39 | { |
||
40 | return Helper::getFileName($this->argument('name')).'.php'; |
||
|
|||
41 | } |
||
42 | |||
43 | public function getPath() |
||
46 | } |
||
47 | } |
||
48 |