| Conditions | 7 |
| Paths | 3 |
| Total Lines | 62 |
| 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 |
||
| 20 | public function boot() |
||
| 21 | { |
||
| 22 | /* |
||
| 23 | * Optional methods to load your package assets |
||
| 24 | */ |
||
| 25 | // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'bill-me'); |
||
| 26 | // $this->loadViewsFrom(__DIR__.'/../resources/views', 'bill-me'); |
||
| 27 | // $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); |
||
| 28 | // $this->loadRoutesFrom(__DIR__.'/routes.php'); |
||
| 29 | |||
| 30 | |||
| 31 | $this->loadViewsFrom(__DIR__ . '/../resources/views', 'billme'); |
||
| 32 | |||
| 33 | |||
| 34 | $this->publishes([ |
||
| 35 | __DIR__.'/../resources/views' => resource_path('views/vendor/billme'), |
||
| 36 | ]); |
||
| 37 | |||
| 38 | |||
| 39 | if ($this->app->runningInConsole()) { |
||
| 40 | $this->publishes([ |
||
| 41 | __DIR__ . '/../config/config.php' => config_path('bill-me.php'), |
||
| 42 | ], 'config'); |
||
| 43 | |||
| 44 | |||
| 45 | //publishing migrations here.. |
||
| 46 | if (!class_exists('CreateOrdersTable') && !class_exists('CreateOrderItemsTable') && !class_exists('CreateInvoicesTable') && !class_exists('CreatePaymentMethodTable') && !class_exists('CreatePaymentsTable')) { |
||
| 47 | $this->publishes([ |
||
| 48 | __DIR__ . '/../database/migrations/create_orders_table.php.stub' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_orders_table.php'), |
||
| 49 | __DIR__ . '/../database/migrations/create_order_items_table.php.stub' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_order_items_table.php'), |
||
| 50 | __DIR__ . '/../database/migrations/create_invoices_table.php.stub' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_invoices_table.php'), |
||
| 51 | __DIR__ . '/../database/migrations/create_payment_method_table.php.stub' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_payment_method_table.php'), |
||
| 52 | __DIR__ . '/../database/migrations/create_billing_payment_table.php.stub' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_billing_payment_table.php'), |
||
| 53 | __DIR__ . '/../database/migrations/create_receipts_table.php.stub' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_receipts_table.php'), |
||
| 54 | __DIR__ . '/../database/migrations/create_payment_method_table.php.stub' => database_path('migrations/' . date('Y_m_d_His', time()) . '_create_payment_method_table.php'), |
||
| 55 | |||
| 56 | ], 'migrations'); |
||
| 57 | } |
||
| 58 | |||
| 59 | |||
| 60 | |||
| 61 | |||
| 62 | |||
| 63 | // Publishing the views. |
||
| 64 | /*$this->publishes([ |
||
| 65 | __DIR__.'/../resources/views' => resource_path('views/vendor/bill-me'), |
||
| 66 | ], 'views');*/ |
||
| 67 | |||
| 68 | // Publishing assets. |
||
| 69 | /*$this->publishes([ |
||
| 70 | __DIR__.'/../resources/assets' => public_path('vendor/bill-me'), |
||
| 71 | ], 'assets');*/ |
||
| 72 | |||
| 73 | // Publishing the translation files. |
||
| 74 | /*$this->publishes([ |
||
| 75 | __DIR__.'/../resources/lang' => resource_path('lang/vendor/bill-me'), |
||
| 76 | ], 'lang');*/ |
||
| 77 | |||
| 78 | // Registering package commands. |
||
| 79 | // $this->commands([]); |
||
| 80 | } |
||
| 81 | } |
||
| 82 | |||
| 97 |