1 | <?php |
||
31 | class ServiceProvider extends PragmaRXServiceProvider |
||
32 | { |
||
33 | protected $packageVendor = 'pragmarx'; |
||
34 | |||
35 | protected $packageVendorCapitalized = 'PragmaRX'; |
||
36 | |||
37 | protected $packageName = 'firewall'; |
||
38 | |||
39 | protected $packageNameCapitalized = 'Firewall'; |
||
40 | |||
41 | private $firewall; |
||
42 | |||
43 | /** |
||
44 | * Get the full path of the stub config file. |
||
45 | * |
||
46 | * @throws ConfigurationOptionNotAvailable |
||
47 | * |
||
48 | * @return \Illuminate\Database\Eloquent\Model |
||
49 | */ |
||
50 | 53 | private function getFirewallModel() |
|
51 | { |
||
52 | 53 | if (!$firewallModel = $this->getConfig('firewall_model')) { |
|
53 | 1 | throw new ConfigurationOptionNotAvailable('Config option "firewall_model" is not available, please publish/check your configuration.'); |
|
54 | } |
||
55 | |||
56 | 52 | return new $firewallModel(); |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * Get the current package directory. |
||
61 | * |
||
62 | * @return string |
||
63 | */ |
||
64 | public function getPackageDir() |
||
68 | |||
69 | /** |
||
70 | * Get the root directory for this ServiceProvider. |
||
71 | * |
||
72 | * @return string |
||
73 | */ |
||
74 | 66 | public function getRootDirectory() |
|
78 | |||
79 | /** |
||
80 | * Get the services provided by the provider. |
||
81 | * |
||
82 | * @return array |
||
83 | */ |
||
84 | public function provides() |
||
88 | |||
89 | /** |
||
90 | * Register the service provider. |
||
91 | * |
||
92 | * @return void |
||
93 | */ |
||
94 | 66 | public function register() |
|
139 | |||
140 | /** |
||
141 | * Register the attack blocker. |
||
142 | */ |
||
143 | private function registerAttackBlocker() |
||
149 | |||
150 | /** |
||
151 | * Register the countries repository. |
||
152 | */ |
||
153 | private function registerCountriesRepository() |
||
159 | |||
160 | /** |
||
161 | * Register the Blacklist Artisan command. |
||
162 | * |
||
163 | * @return void |
||
164 | */ |
||
165 | private function registerBlacklistCommand() |
||
173 | |||
174 | /** |
||
175 | * Register the Cache driver used by Firewall. |
||
176 | * |
||
177 | * @return void |
||
178 | */ |
||
179 | private function registerCache() |
||
185 | |||
186 | /** |
||
187 | * Register the List Artisan command. |
||
188 | * |
||
189 | * @return void |
||
190 | */ |
||
191 | private function registerClearCommand() |
||
199 | |||
200 | /** |
||
201 | * Register the Data Repository driver used by Firewall. |
||
202 | * |
||
203 | * @return void |
||
204 | */ |
||
205 | private function registerDataRepository() |
||
211 | |||
212 | /** |
||
213 | * Register event listeners. |
||
214 | */ |
||
215 | 65 | private function registerEventListeners() |
|
219 | |||
220 | /** |
||
221 | * Register the Filesystem driver used by Firewall. |
||
222 | * |
||
223 | * @return void |
||
224 | */ |
||
225 | private function registerFileSystem() |
||
|
|||
226 | { |
||
227 | 65 | $this->app->singleton('firewall.filesystem', function () { |
|
228 | 1 | return new Filesystem(); |
|
229 | 65 | }); |
|
230 | 65 | } |
|
231 | |||
232 | /** |
||
233 | * Takes all the components of Firewall and glues them |
||
234 | * together to create Firewall. |
||
235 | * |
||
236 | * @return void |
||
237 | */ |
||
238 | private function registerFirewall() |
||
256 | |||
257 | private function registerIpAddress() |
||
263 | |||
264 | /** |
||
265 | * Register the ip list repository. |
||
266 | */ |
||
267 | private function registerIpList() |
||
273 | |||
274 | /** |
||
275 | * Register the message repository. |
||
276 | */ |
||
277 | private function registerMessageRepository() |
||
283 | |||
284 | /** |
||
285 | * Register blocking and unblocking Middleware. |
||
286 | * |
||
287 | * @return void |
||
288 | */ |
||
289 | private function registerMiddleware() |
||
299 | |||
300 | 65 | private function registerMigrations() |
|
304 | |||
305 | private function registerGeoIp() |
||
311 | |||
312 | /** |
||
313 | * Register the List Artisan command. |
||
314 | * |
||
315 | * @return void |
||
316 | */ |
||
317 | private function registerRemoveCommand() |
||
325 | |||
326 | /** |
||
327 | * Register the List Artisan command. |
||
328 | * |
||
329 | * @return void |
||
330 | */ |
||
331 | private function registerReportCommand() |
||
339 | |||
340 | /** |
||
341 | * Register the updategeoip command. |
||
342 | */ |
||
343 | private function registerUpdateGeoIpCommand() |
||
351 | |||
352 | /** |
||
353 | * Register the Whitelist Artisan command. |
||
354 | * |
||
355 | * @return void |
||
356 | */ |
||
357 | private function registerWhitelistCommand() |
||
365 | } |
||
366 |
Overwriting private methods is generally fine as long as you also use private visibility. It might still be preferable for understandability to use a different method name.