diff --git a/composer.lock b/composer.lock index 6adc5a4..c26b52e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "b04c7356be97fd379c1cb13021ca84dd", + "hash": "290ec143f080e1c734a859e075fe8298", "content-hash": "a79fdbd91551aa896dfeebc869a1fa27", "packages": [ { @@ -76,27 +76,27 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.2.0", + "version": "6.2.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "d094e337976dff9d8e2424e8485872194e768662" + "reference": "3f808fba627f2c5b69e2501217bf31af349c1427" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d094e337976dff9d8e2424e8485872194e768662", - "reference": "d094e337976dff9d8e2424e8485872194e768662", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/3f808fba627f2c5b69e2501217bf31af349c1427", + "reference": "3f808fba627f2c5b69e2501217bf31af349c1427", "shasum": "" }, "require": { - "guzzlehttp/promises": "~1.0", - "guzzlehttp/psr7": "~1.1", - "php": ">=5.5.0" + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.3.1", + "php": ">=5.5" }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "~4.0", - "psr/log": "~1.0" + "phpunit/phpunit": "^4.0", + "psr/log": "^1.0" }, "type": "library", "extra": { @@ -134,7 +134,7 @@ "rest", "web service" ], - "time": "2016-03-21 20:02:09" + "time": "2016-07-15 17:22:37" }, { "name": "guzzlehttp/promises", diff --git a/src/Exceptions/WatsonBridgeException.php b/src/Exceptions/WatsonBridgeException.php index a3c7bc0..e0c8e20 100644 --- a/src/Exceptions/WatsonBridgeException.php +++ b/src/Exceptions/WatsonBridgeException.php @@ -24,7 +24,7 @@ class WatsonBridgeException extends RuntimeException public function __construct($message = '', $code = 400, Exception $previous = null) { //Format message - $message = 'Watson Bridge: '.(($message != '') ? $message : $this->message); + $message = 'Watson Bridge: ' . (($message != '') ? $message : $this->message); //Call parent exception parent::__construct($message, $code, $previous); } diff --git a/src/Token.php b/src/Token.php index e26cca1..0b7af26 100644 --- a/src/Token.php +++ b/src/Token.php @@ -34,7 +34,7 @@ public function __construct($username, $payLoad = []) //Set Username for token $this->username = $username; //Have payload to set - if (!empty($payLoad)) { + if (! empty($payLoad)) { $this->payLoad = $payLoad; } else { //Load from file @@ -49,7 +49,7 @@ public function __construct($username, $payLoad = []) */ public function hasPayLoad() { - return !empty($this->payLoad); + return ! empty($this->payLoad); } /** @@ -59,7 +59,7 @@ public function hasPayLoad() */ public function exists() { - return file_exists(__DIR__.'/Storage/'.'token-'.$this->username.'.json'); + return file_exists(__DIR__ . '/Storage/' . 'token-' . $this->username . '.json'); } /** @@ -79,7 +79,7 @@ public function isExpired() */ public function isNotExpired() { - return !$this->isExpired(); + return ! $this->isExpired(); } /** @@ -100,7 +100,7 @@ public function isValid() public function save() { //No payload to save - if (!$this->hasPayLoad()) { + if (! $this->hasPayLoad()) { return false; } //Save the token @@ -114,7 +114,7 @@ public function save() */ public function getFilePath() { - return __DIR__.'/Storage/token-'.$this->username.'.json'; + return __DIR__ . '/Storage/token-' . $this->username . '.json'; } /** @@ -125,7 +125,7 @@ public function getFilePath() public function loadPayLoadFromFile() { //Not found - if (!$this->exists()) { + if (! $this->exists()) { //We return empty array return []; } diff --git a/tests/TestToken.php b/tests/TestToken.php index e9dba39..7628eb8 100644 --- a/tests/TestToken.php +++ b/tests/TestToken.php @@ -47,7 +47,7 @@ public function tearDown() public function createTestTokenFile($name = '', $data = []) { file_put_contents( - $this->getTokenStoragePath($name.'.json'), + $this->getTokenStoragePath($name . '.json'), collect($data)->toJson(), LOCK_EX ); @@ -62,7 +62,7 @@ public function createTestTokenFile($name = '', $data = []) */ public function deleteTestTokenFile($name = '') { - unlink($this->getTokenStoragePath($name.'.json')); + unlink($this->getTokenStoragePath($name . '.json')); } /** @@ -74,7 +74,7 @@ public function deleteTestTokenFile($name = '') */ public function getTokenStoragePath($file = '') { - return __DIR__.'/../src/Storage/'.$file; + return __DIR__ . '/../src/Storage/' . $file; } /**