1 | <?php |
||
10 | class Module |
||
11 | { |
||
12 | use Normalizer, Replacer; |
||
13 | |||
14 | /** |
||
15 | * @var |
||
16 | */ |
||
17 | protected $name; |
||
18 | |||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | protected $options; |
||
23 | |||
24 | /** |
||
25 | * @var Config |
||
26 | */ |
||
27 | protected $config; |
||
28 | |||
29 | /** |
||
30 | * @var Application |
||
31 | */ |
||
32 | protected $laravel; |
||
33 | |||
34 | /** |
||
35 | * Module constructor. |
||
36 | * |
||
37 | * @param string $name |
||
38 | * @param Application $application |
||
39 | * @param array $options |
||
40 | */ |
||
41 | public function __construct( |
||
51 | |||
52 | /** |
||
53 | * Get module name |
||
54 | * |
||
55 | * @return string |
||
56 | */ |
||
57 | public function name() |
||
61 | |||
62 | /** |
||
63 | * Get module seeder class name (with namespace) |
||
64 | * |
||
65 | * @param string|null $class |
||
66 | * |
||
67 | * @return string |
||
68 | */ |
||
69 | public function seederClass($class = null) |
||
73 | |||
74 | /** |
||
75 | * Get module service provider class |
||
76 | * |
||
77 | * @return string |
||
78 | */ |
||
79 | public function serviceProviderClass() |
||
83 | |||
84 | /** |
||
85 | * Get file class |
||
86 | * |
||
87 | * @param string $type |
||
88 | * @param string|null $class |
||
89 | * |
||
90 | * @return string |
||
91 | */ |
||
92 | protected function fileClass($type, $class = null) |
||
103 | |||
104 | /** |
||
105 | * Get module directory |
||
106 | * |
||
107 | * @return string |
||
108 | */ |
||
109 | public function directory() |
||
114 | |||
115 | /** |
||
116 | * Get module migrations path |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | public function migrationsPath() |
||
125 | |||
126 | /** |
||
127 | * Verify whether module has service provider |
||
128 | * |
||
129 | * @return bool |
||
130 | */ |
||
131 | public function hasServiceProvider() |
||
135 | |||
136 | /** |
||
137 | * Verifies whether module has factory |
||
138 | * |
||
139 | * @return bool |
||
140 | */ |
||
141 | public function hasFactory() |
||
145 | |||
146 | /** |
||
147 | * Verifies whether module has routes file |
||
148 | * |
||
149 | * @param array $data |
||
150 | * |
||
151 | * @return bool |
||
152 | */ |
||
153 | public function hasRoutes(array $data = []) |
||
154 | { |
||
155 | $prefix = $this->routePrefix($data); |
||
156 | |||
157 | return $this->hasFile('routes', 'routesFilePath', $prefix); |
||
158 | } |
||
159 | |||
160 | /** |
||
161 | * Verifies whether module has seeder file |
||
162 | * |
||
163 | * @return bool |
||
164 | */ |
||
165 | public function hasSeeder() |
||
169 | |||
170 | /** |
||
171 | * Verifies whether module has file of given type either checking config |
||
172 | * and if it's not exist by checking whether file exists |
||
173 | * |
||
174 | * @param string $option |
||
175 | * @param string $pathFunction |
||
176 | * @param string $prefix |
||
177 | * |
||
178 | * @return bool |
||
179 | */ |
||
180 | protected function hasFile($option, $pathFunction, $prefix = '') |
||
186 | |||
187 | /** |
||
188 | * Get controller namespace for routing |
||
189 | * |
||
190 | * @return string |
||
191 | */ |
||
192 | public function routingControllerNamespace() |
||
197 | |||
198 | /** |
||
199 | * Get module routes file (with path) |
||
200 | * |
||
201 | * @param string $prefix |
||
202 | * |
||
203 | * @return string |
||
204 | */ |
||
205 | public function routesFilePath($prefix) |
||
209 | |||
210 | /** |
||
211 | * Get route prefix |
||
212 | * |
||
213 | * @param array $data |
||
214 | * |
||
215 | * @return string |
||
216 | */ |
||
217 | public function routePrefix(array $data) |
||
221 | |||
222 | /** |
||
223 | * Get module factory file path |
||
224 | * |
||
225 | * @return string |
||
226 | */ |
||
227 | public function factoryFilePath() |
||
231 | |||
232 | /** |
||
233 | * Get module factory file path |
||
234 | * |
||
235 | * @return string |
||
236 | */ |
||
237 | public function seederFilePath() |
||
241 | |||
242 | /** |
||
243 | * Get module service provider file path |
||
244 | * |
||
245 | * @return string |
||
246 | */ |
||
247 | public function serviceProviderFilePath() |
||
251 | |||
252 | /** |
||
253 | * Get path |
||
254 | * |
||
255 | * @param string $configMethod |
||
256 | * @param string $prefix |
||
257 | * |
||
258 | * @return string |
||
259 | */ |
||
260 | protected function getPath($configMethod, $prefix = '') |
||
265 | |||
266 | /** |
||
267 | * Verifies whether given module is active |
||
268 | * |
||
269 | * @return bool |
||
270 | */ |
||
271 | public function active() |
||
275 | } |
||
276 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..