1 | <?php |
||
9 | trait ConsoleTools |
||
10 | { |
||
11 | /** |
||
12 | * Publish package migrations. |
||
13 | * |
||
14 | * @return void |
||
15 | */ |
||
16 | protected function publishesMigrations(string $package, bool $isModule = false): void |
||
42 | |||
43 | /** |
||
44 | * Publish package config. |
||
45 | * |
||
46 | * @return void |
||
47 | */ |
||
48 | protected function publishesConfig(string $package, bool $isModule = false): void |
||
62 | |||
63 | /** |
||
64 | * Publish package views. |
||
65 | * |
||
66 | * @return void |
||
67 | */ |
||
68 | protected function publishesViews(string $package, bool $isModule = false): void |
||
82 | |||
83 | /** |
||
84 | * Publish package lang. |
||
85 | * |
||
86 | * @return void |
||
87 | */ |
||
88 | protected function publishesLang(string $package, bool $isModule = false): void |
||
102 | |||
103 | /** |
||
104 | * Determine if the application is running in the console. |
||
105 | * |
||
106 | * @TODO: Implement this method to detect if we're in active dev zone or not! |
||
107 | * Ex: running inside cortex/console action |
||
108 | * |
||
109 | * @return bool |
||
110 | */ |
||
111 | public function runningInDevzone() |
||
115 | |||
116 | /** |
||
117 | * Register console commands. |
||
118 | * |
||
119 | * @param array $commands |
||
120 | * |
||
121 | * @return void |
||
122 | */ |
||
123 | protected function registerCommands(array $commands): void |
||
135 | |||
136 | /** |
||
137 | * Register models into IoC. |
||
138 | * |
||
139 | * @param array $models |
||
140 | * |
||
141 | * @return void |
||
142 | */ |
||
143 | protected function registerModels(array $models): void |
||
150 | |||
151 | /** |
||
152 | * Can publish resources. |
||
153 | * |
||
154 | * @return bool |
||
155 | */ |
||
156 | protected function publishesResources(): bool |
||
160 | |||
161 | /** |
||
162 | * Can autoload migrations. |
||
163 | * |
||
164 | * @param string $module |
||
165 | * |
||
166 | * @return bool |
||
167 | */ |
||
168 | protected function autoloadMigrations(string $module): bool |
||
172 | } |
||
173 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: