| Total Complexity | 5 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class TmdbServiceProviderLaravel extends ServiceProvider { |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Bootstrap the application events. |
||
| 15 | * |
||
| 16 | * @return void |
||
| 17 | */ |
||
| 18 | public function boot() |
||
| 19 | { |
||
| 20 | $this->publishes([ |
||
| 21 | $this->defaultConfig() => config_path('tmdb.php'), |
||
|
|
|||
| 22 | ]); |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Register the service provider. |
||
| 27 | * |
||
| 28 | * @return void |
||
| 29 | */ |
||
| 30 | public function register() |
||
| 31 | { |
||
| 32 | $this->setupConfiguration(); |
||
| 33 | |||
| 34 | $this->app->bind('Tmdb\Laravel\Adapters\EventDispatcherAdapter', 'Tmdb\Laravel\Adapters\EventDispatcherLaravel'); |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Get the TMDB configuration from the config repository |
||
| 39 | * |
||
| 40 | * @return array |
||
| 41 | */ |
||
| 42 | public function config() |
||
| 43 | { |
||
| 44 | return $this->app['config']->get('tmdb'); |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Setup configuration |
||
| 49 | * |
||
| 50 | * @return void |
||
| 51 | */ |
||
| 52 | private function setupConfiguration() |
||
| 53 | { |
||
| 54 | $config = $this->defaultConfig(); |
||
| 55 | $this->mergeConfigFrom($config, 'tmdb'); |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Returns the default configuration path |
||
| 60 | * |
||
| 61 | * @return string |
||
| 62 | */ |
||
| 63 | private function defaultConfig() |
||
| 66 | } |
||
| 67 | } |
||
| 68 |