From b6a1b24ac2250e33159f0fc68c045f3f7d837300 Mon Sep 17 00:00:00 2001 From: Percy Mamedy Date: Mon, 31 Oct 2016 16:11:41 +0000 Subject: [PATCH 1/2] Applied fixes from StyleCI --- src/AbstractPersonalityInsights.php | 2 +- .../MissingParameterContentItemException.php | 2 +- src/InsightsServiceProvider.php | 10 +++++----- src/Support/DataCollector/ContentListContainer.php | 2 +- tests/TestInsights.php | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/AbstractPersonalityInsights.php b/src/AbstractPersonalityInsights.php index 951f744..dd7a47f 100644 --- a/src/AbstractPersonalityInsights.php +++ b/src/AbstractPersonalityInsights.php @@ -68,7 +68,7 @@ public function getContainer() public function usingCredentials($name = null) { //set credentials name - $this->credentialsName = Config::has('personality-insights.credentials.'.$name) ? $name : null; + $this->credentialsName = Config::has('personality-insights.credentials.' . $name) ? $name : null; //Return this object return $this; } diff --git a/src/Exceptions/MissingParameterContentItemException.php b/src/Exceptions/MissingParameterContentItemException.php index 9f2ca9c..9ad47e6 100644 --- a/src/Exceptions/MissingParameterContentItemException.php +++ b/src/Exceptions/MissingParameterContentItemException.php @@ -27,7 +27,7 @@ class MissingParameterContentItemException extends RuntimeException public function __construct($message = '', $code = 400, Exception $previous = null) { //Format message - $message = 'ContentItem Error: '.(($message != '') ? $message : $this->message); + $message = 'ContentItem Error: ' . (($message != '') ? $message : $this->message); //Call parent exception parent::__construct($message, $code, $previous); } diff --git a/src/InsightsServiceProvider.php b/src/InsightsServiceProvider.php index 1d8e0d9..f74a8b1 100644 --- a/src/InsightsServiceProvider.php +++ b/src/InsightsServiceProvider.php @@ -41,7 +41,7 @@ public function boot() { //Publish config file $this->publishes([ - __DIR__.'/config/personality-insights.php' => config_path('personality-insights.php'), + __DIR__ . '/config/personality-insights.php' => config_path('personality-insights.php'), ], 'config'); } @@ -53,7 +53,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(); //Register Facades @@ -76,11 +76,11 @@ public function registerBindings() //Bind WatsonBridge for Personality insights that we depend on $this->app->bind('PersonalityInsightsBridge', function ($app, $args) { //Get Username - $username = config('personality-insights.credentials.'.$args['credentialsName'].'.username'); + $username = config('personality-insights.credentials.' . $args['credentialsName'] . '.username'); //Get Password - $password = config('personality-insights.credentials.'.$args['credentialsName'].'.password'); + $password = config('personality-insights.credentials.' . $args['credentialsName'] . '.password'); //Get base url - $url = config('personality-insights.credentials.'.$args['credentialsName'].'.url'); + $url = config('personality-insights.credentials.' . $args['credentialsName'] . '.url'); //Return bridge return new Bridge($username, $password, $url); }); diff --git a/src/Support/DataCollector/ContentListContainer.php b/src/Support/DataCollector/ContentListContainer.php index 8af5731..6ac8bf5 100644 --- a/src/Support/DataCollector/ContentListContainer.php +++ b/src/Support/DataCollector/ContentListContainer.php @@ -44,7 +44,7 @@ public function cleanContainer() public function getCacheKey() { //Return Key - return 'PersonalityInsights-'.Uuid::uuid5(Uuid::NAMESPACE_DNS, collect(['contentItems' => $this->toArray()])->toJson())->toString(); + return 'PersonalityInsights-' . Uuid::uuid5(Uuid::NAMESPACE_DNS, collect(['contentItems' => $this->toArray()])->toJson())->toString(); } /** diff --git a/tests/TestInsights.php b/tests/TestInsights.php index 54dc6d6..1908e57 100644 --- a/tests/TestInsights.php +++ b/tests/TestInsights.php @@ -50,9 +50,9 @@ public function setUp() ->setMethods(['post']) ->getMock(); // Mock Contents - $this->contentItems = json_decode(file_get_contents(__DIR__.'/Mocks/content-items.json'), true)['contentItems']; + $this->contentItems = json_decode(file_get_contents(__DIR__ . '/Mocks/content-items.json'), true)['contentItems']; // Mock Response Body - $this->jsonResponse = file_get_contents(__DIR__.'/Mocks/profile-response.json'); + $this->jsonResponse = file_get_contents(__DIR__ . '/Mocks/profile-response.json'); // Set return value of post method $this->bridge->method('post')->withAnyParameters()->willReturn(new Response(200, [], $this->jsonResponse)); From 678208bd0e041e135471dc86ce4e9a9dccfd40e5 Mon Sep 17 00:00:00 2001 From: Percy Mamedy Date: Mon, 31 Oct 2016 23:02:37 +0400 Subject: [PATCH 2/2] Sensio lab line feed recommendation in .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0f550ff..2f87cd7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /vendor composer.phar -composer.lock \ No newline at end of file +composer.lock