Conditions | 2 |
Paths | 2 |
Total Lines | 61 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
14 | public function boot() |
||
15 | { |
||
16 | /* |
||
17 | * Optional methods to load your package assets |
||
18 | */ |
||
19 | $this->loadTranslationsFrom(__DIR__.'/resources/lang', 'laravel-mobilpay'); |
||
20 | $this->loadViewsFrom(__DIR__.'/resources/views', 'laravel-mobilpay'); |
||
21 | $this->loadMigrationsFrom(__DIR__.'/database/migrations'); |
||
22 | $this->loadRoutesFrom(__DIR__.'/routes/web.php'); |
||
23 | |||
24 | if ($this->app->runningInConsole()) { |
||
25 | $this->publishes([ |
||
26 | __DIR__.'/config/laravel-mobilpay.php' => config_path('laravel-mobilpay.php'), |
||
27 | ], 'config'); |
||
28 | |||
29 | // Publishing the views. |
||
30 | $this->publishes([ |
||
31 | __DIR__.'/resources/views/laravel-mobilpay' => resource_path('views/vendor/laravel-mobilpay'), |
||
32 | ], 'views'); |
||
33 | |||
34 | // Publishing assets. |
||
35 | $this->publishes([ |
||
36 | __DIR__.'/resources/assets' => public_path('vendor/laravel-mobilpay'), |
||
37 | ], 'assets'); |
||
38 | |||
39 | // Publishing the translation files. |
||
40 | $this->publishes([ |
||
41 | __DIR__.'/resources/lang' => resource_path('lang/vendor/laravel-mobilpay'), |
||
42 | ], 'lang'); |
||
43 | |||
44 | |||
45 | // Publishing Observes files. |
||
46 | //if you want to use observers uncoment below |
||
47 | // $this->publishes([ |
||
48 | // __DIR__.'/Observers' => app_path('Observers'), |
||
49 | // ]); |
||
50 | |||
51 | // Publishing custom classes files. |
||
52 | $this->publishes([ |
||
53 | __DIR__.'/LaravelMobilpay' => app_path('LaravelMobilpay'), |
||
54 | ]); |
||
55 | |||
56 | // Registering package commands. |
||
57 | // $this->commands([]); |
||
58 | } |
||
59 | |||
60 | // if you want to use observers uncoment below |
||
61 | // if(config('laravel-mobilpay.transaction_observer_active')){ |
||
62 | // |
||
63 | // try { |
||
64 | // if(class_exists('App\Observers\TransactionsObserver')){ |
||
65 | // MobilpayTransaction::observe(TransactionsObserver::class); |
||
66 | // } |
||
67 | // else{ |
||
68 | // Log::debug(__METHOD__.' Transactions observer does not exist'); |
||
69 | // } |
||
70 | // } catch (Exception $e) { |
||
71 | // } |
||
72 | // |
||
73 | // } |
||
74 | } |
||
75 | |||
90 |