@@ -25,56 +25,56 @@ |
||
| 25 | 25 | |
| 26 | 26 | class ResponseBuilderServiceProvider extends ServiceProvider |
| 27 | 27 | { |
| 28 | - protected $config_files = [ |
|
| 29 | - 'response_builder.php', |
|
| 30 | - ]; |
|
| 28 | + protected $config_files = [ |
|
| 29 | + 'response_builder.php', |
|
| 30 | + ]; |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * Register bindings in the container. |
|
| 34 | - * |
|
| 35 | - * @return void |
|
| 36 | - */ |
|
| 37 | - public function register() |
|
| 38 | - { |
|
| 39 | - foreach ($this->config_files as $file) { |
|
| 40 | - $this->mergeConfigFrom(__DIR__ . "/../config/{$file}", ResponseBuilder::CONF_CONFIG); |
|
| 41 | - } |
|
| 42 | - } |
|
| 32 | + /** |
|
| 33 | + * Register bindings in the container. |
|
| 34 | + * |
|
| 35 | + * @return void |
|
| 36 | + */ |
|
| 37 | + public function register() |
|
| 38 | + { |
|
| 39 | + foreach ($this->config_files as $file) { |
|
| 40 | + $this->mergeConfigFrom(__DIR__ . "/../config/{$file}", ResponseBuilder::CONF_CONFIG); |
|
| 41 | + } |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * Sets up package resources |
|
| 46 | - * |
|
| 47 | - * @return void |
|
| 48 | - */ |
|
| 49 | - public function boot() |
|
| 50 | - { |
|
| 51 | - $this->loadTranslationsFrom(__DIR__ . '/lang', 'response-builder'); |
|
| 44 | + /** |
|
| 45 | + * Sets up package resources |
|
| 46 | + * |
|
| 47 | + * @return void |
|
| 48 | + */ |
|
| 49 | + public function boot() |
|
| 50 | + { |
|
| 51 | + $this->loadTranslationsFrom(__DIR__ . '/lang', 'response-builder'); |
|
| 52 | 52 | |
| 53 | - foreach ($this->config_files as $file) { |
|
| 54 | - $this->publishes([__DIR__ . "/../config/{$file}" => config_path($file)]); |
|
| 55 | - } |
|
| 56 | - } |
|
| 53 | + foreach ($this->config_files as $file) { |
|
| 54 | + $this->publishes([__DIR__ . "/../config/{$file}" => config_path($file)]); |
|
| 55 | + } |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - /** |
|
| 59 | - * Merge the given configuration with the existing configuration. |
|
| 60 | - * |
|
| 61 | - * @param string $path |
|
| 62 | - * @param string $key |
|
| 63 | - * |
|
| 64 | - * @return void |
|
| 65 | - */ |
|
| 66 | - protected function mergeConfigFrom($path, $key) |
|
| 67 | - { |
|
| 68 | - $defaults = require $path; |
|
| 69 | - $config = $this->app['config']->get($key, []); |
|
| 58 | + /** |
|
| 59 | + * Merge the given configuration with the existing configuration. |
|
| 60 | + * |
|
| 61 | + * @param string $path |
|
| 62 | + * @param string $key |
|
| 63 | + * |
|
| 64 | + * @return void |
|
| 65 | + */ |
|
| 66 | + protected function mergeConfigFrom($path, $key) |
|
| 67 | + { |
|
| 68 | + $defaults = require $path; |
|
| 69 | + $config = $this->app['config']->get($key, []); |
|
| 70 | 70 | |
| 71 | - $merged_config = Util::mergeConfig($defaults, $config); |
|
| 71 | + $merged_config = Util::mergeConfig($defaults, $config); |
|
| 72 | 72 | |
| 73 | - if (\array_key_exists('converter', $merged_config)) { |
|
| 74 | - Util::sortArrayByPri($merged_config['converter']); |
|
| 75 | - } |
|
| 73 | + if (\array_key_exists('converter', $merged_config)) { |
|
| 74 | + Util::sortArrayByPri($merged_config['converter']); |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | - $this->app['config']->set($key, $merged_config); |
|
| 78 | - } |
|
| 77 | + $this->app['config']->set($key, $merged_config); |
|
| 78 | + } |
|
| 79 | 79 | |
| 80 | 80 | } |