1 | <?php |
||
12 | class Generator extends Command |
||
13 | { |
||
14 | /** |
||
15 | * The name and signature of the console command. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $signature = 'make:repository |
||
20 | {name : Class (singular) for example User}'; |
||
21 | |||
22 | /** |
||
23 | * The console command description. |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $description = 'Create repository generator'; |
||
28 | |||
29 | /** |
||
30 | * The repository name. |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $repoName; |
||
35 | /** |
||
36 | * The repository name space. |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $repoNamespace; |
||
41 | |||
42 | /** |
||
43 | * Create a new command instance. |
||
44 | * |
||
45 | * @return void |
||
|
|||
46 | */ |
||
47 | public function __construct() |
||
51 | |||
52 | /** |
||
53 | * Execute the console command. |
||
54 | * |
||
55 | * @return void |
||
56 | */ |
||
57 | public function handle() |
||
83 | |||
84 | /** |
||
85 | * Get stub content to generate needed files |
||
86 | * |
||
87 | * @param string $type determine which stub should choose to get content |
||
88 | * @return false|string |
||
89 | */ |
||
90 | protected function getStub($type) |
||
94 | |||
95 | /** |
||
96 | * @param string $name Class name |
||
97 | * @param string $path Class path |
||
98 | * @param string $folder default path to generate in |
||
99 | * @param string $type define which kind of files should generate |
||
100 | */ |
||
101 | protected function generate($path, $folder, $type) |
||
119 | |||
120 | /** |
||
121 | * Check if folder exist |
||
122 | * @param string $path class path |
||
123 | * @return string |
||
124 | */ |
||
125 | public function checkFolder($path) |
||
133 | } |
||
134 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.