From ddd465f2c0287faa26e797f3457302c078cd47ee Mon Sep 17 00:00:00 2001 From: Percy Mamedy Date: Sun, 28 May 2017 12:27:55 +0400 Subject: [PATCH] Refactoring Moved config folder outside src Added .editorconfig --- .editorconfig | 16 ++++++++++++++++ .gitattributes | 1 + {src/config => config}/personality-insights.php | 0 src/InsightsServiceProvider.php | 13 ++++++++----- 4 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 .editorconfig rename {src/config => config}/personality-insights.php (100%) diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..1492202 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[*.yml] +indent_style = space +indent_size = 2 diff --git a/.gitattributes b/.gitattributes index 2b0be76..a0daeb6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ * text=auto +.editorconfig export-ignore /tests export-ignore .gitattributes export-ignore .gitignore export-ignore diff --git a/src/config/personality-insights.php b/config/personality-insights.php similarity index 100% rename from src/config/personality-insights.php rename to config/personality-insights.php diff --git a/src/InsightsServiceProvider.php b/src/InsightsServiceProvider.php index 1f2c144..726f74d 100644 --- a/src/InsightsServiceProvider.php +++ b/src/InsightsServiceProvider.php @@ -22,8 +22,9 @@ class InsightsServiceProvider extends ServiceProvider public function boot() { // Publish config file. - $this->publishes([__DIR__.'/config/personality-insights.php' => config_path('personality-insights.php')], - 'config'); + $this->publishes([ + __DIR__.'/../config/personality-insights.php' => config_path('personality-insights.php'), + ], 'config'); } /** @@ -34,7 +35,7 @@ public function boot() public function register() { // Merge Config File. - $this->mergeConfigFrom(__DIR__.'/config/personality-insights.php', 'personality-insights'); + $this->mergeConfigFrom(__DIR__.'/../config/personality-insights.php', 'personality-insights'); // Register Bindings. $this->registerBindings(); @@ -81,8 +82,10 @@ protected function registerAccessManager() /** @var Repository $configRepo */ $configRepo = $app->make('config'); - return new AccessManager($configRepo->get('personality-insights.default_credentials'), - $configRepo->get('personality-insights.api_version')); + return new AccessManager( + $configRepo->get('personality-insights.default_credentials'), + $configRepo->get('personality-insights.api_version') + ); }); }