Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
percymamedy committed Oct 31, 2016
2 parents dfba794 + 678208b commit b5bcdce
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/vendor
composer.phar
composer.lock
composer.lock
2 changes: 1 addition & 1 deletion src/AbstractPersonalityInsights.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/MissingParameterContentItemException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
10 changes: 5 additions & 5 deletions src/InsightsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand All @@ -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
Expand All @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/Support/DataCollector/ContentListContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/TestInsights.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit b5bcdce

Please sign in to comment.