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

Commit 820c768

Browse files
committed
Merge branch 'master' into 1.0
2 parents 50326fe + 421ae01 commit 820c768

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

composer.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Exceptions/WatsonBridgeException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class WatsonBridgeException extends RuntimeException
2424
public function __construct($message = '', $code = 400, Exception $previous = null)
2525
{
2626
//Format message
27-
$message = 'Watson Bridge: '.(($message != '') ? $message : $this->message);
27+
$message = 'Watson Bridge: ' . (($message != '') ? $message : $this->message);
2828
//Call parent exception
2929
parent::__construct($message, $code, $previous);
3030
}

src/Token.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct($username, $payLoad = [])
3434
//Set Username for token
3535
$this->username = $username;
3636
//Have payload to set
37-
if (!empty($payLoad)) {
37+
if (! empty($payLoad)) {
3838
$this->payLoad = $payLoad;
3939
} else {
4040
//Load from file
@@ -49,7 +49,7 @@ public function __construct($username, $payLoad = [])
4949
*/
5050
public function hasPayLoad()
5151
{
52-
return !empty($this->payLoad);
52+
return ! empty($this->payLoad);
5353
}
5454

5555
/**
@@ -59,7 +59,7 @@ public function hasPayLoad()
5959
*/
6060
public function exists()
6161
{
62-
return file_exists(__DIR__.'/Storage/'.'token-'.$this->username.'.json');
62+
return file_exists(__DIR__ . '/Storage/' . 'token-' . $this->username . '.json');
6363
}
6464

6565
/**
@@ -79,7 +79,7 @@ public function isExpired()
7979
*/
8080
public function isNotExpired()
8181
{
82-
return !$this->isExpired();
82+
return ! $this->isExpired();
8383
}
8484

8585
/**
@@ -100,7 +100,7 @@ public function isValid()
100100
public function save()
101101
{
102102
//No payload to save
103-
if (!$this->hasPayLoad()) {
103+
if (! $this->hasPayLoad()) {
104104
return false;
105105
}
106106
//Save the token
@@ -114,7 +114,7 @@ public function save()
114114
*/
115115
public function getFilePath()
116116
{
117-
return __DIR__.'/Storage/token-'.$this->username.'.json';
117+
return __DIR__ . '/Storage/token-' . $this->username . '.json';
118118
}
119119

120120
/**
@@ -125,7 +125,7 @@ public function getFilePath()
125125
public function loadPayLoadFromFile()
126126
{
127127
//Not found
128-
if (!$this->exists()) {
128+
if (! $this->exists()) {
129129
//We return empty array
130130
return [];
131131
}

tests/TestToken.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function tearDown()
4747
public function createTestTokenFile($name = '', $data = [])
4848
{
4949
file_put_contents(
50-
$this->getTokenStoragePath($name.'.json'),
50+
$this->getTokenStoragePath($name . '.json'),
5151
collect($data)->toJson(),
5252
LOCK_EX
5353
);
@@ -62,7 +62,7 @@ public function createTestTokenFile($name = '', $data = [])
6262
*/
6363
public function deleteTestTokenFile($name = '')
6464
{
65-
unlink($this->getTokenStoragePath($name.'.json'));
65+
unlink($this->getTokenStoragePath($name . '.json'));
6666
}
6767

6868
/**
@@ -74,7 +74,7 @@ public function deleteTestTokenFile($name = '')
7474
*/
7575
public function getTokenStoragePath($file = '')
7676
{
77-
return __DIR__.'/../src/Storage/'.$file;
77+
return __DIR__ . '/../src/Storage/' . $file;
7878
}
7979

8080
/**

0 commit comments

Comments
 (0)