| Total Complexity | 4 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class PayPalServiceProvider extends ServiceProvider |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * Indicates if loading of the provider is deferred. |
||
| 17 | * |
||
| 18 | * @var bool |
||
| 19 | */ |
||
| 20 | protected $defer = false; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Bootstrap the application events. |
||
| 24 | * |
||
| 25 | * @return void |
||
| 26 | */ |
||
| 27 | public function boot() |
||
| 28 | { |
||
| 29 | // Publish config files |
||
| 30 | $this->publishes([ |
||
| 31 | __DIR__.'/../../config/config.php' => config_path('paypal.php'), |
||
| 32 | ]); |
||
| 33 | |||
| 34 | // Publish Lang Files |
||
| 35 | $this->loadTranslationsFrom(__DIR__.'/../../lang', 'paypal'); |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Register the service provider. |
||
| 40 | * |
||
| 41 | * @return void |
||
| 42 | */ |
||
| 43 | public function register() |
||
| 44 | { |
||
| 45 | $this->registerPayPal(); |
||
| 46 | |||
| 47 | $this->mergeConfig(); |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Register the application bindings. |
||
| 52 | * |
||
| 53 | * @return void |
||
| 54 | */ |
||
| 55 | private function registerPayPal() |
||
| 56 | { |
||
| 57 | $this->app->singleton('paypal_client', static function () { |
||
| 58 | return new PayPalClient(); |
||
| 59 | }); |
||
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Merges user's and paypal's configs. |
||
| 64 | * |
||
| 65 | * @return void |
||
| 66 | */ |
||
| 67 | private function mergeConfig() |
||
| 72 | ); |
||
| 73 | } |
||
| 74 | } |
||
| 75 |