Skip to content

Commit 5c51973

Browse files
committed
Rename AccountStore rename to TokenStore
1 parent c121867 commit 5c51973

File tree

5 files changed

+17
-18
lines changed

5 files changed

+17
-18
lines changed

Atomx/AtomxClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ class AtomxClient extends ApiClient {
1111
protected $requiresToken = true;
1212

1313
/**
14-
* @var AccountStore Store the token for the application
14+
* @var TokenStore Store the token for the application
1515
*/
1616
protected $accountStore = null;
1717

1818
/**
1919
* AtomxClient constructor.
20-
* @param AccountStore|null $accountStore
20+
* @param TokenStore|null $accountStore
2121
* @param int|array $idOrFields
2222
* @param string $apiBase
2323
*/
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use Atomx\Exceptions\TotpRequiredException;
44
use Atomx\Resources\Login;
55

6-
class LoginAccountStore implements AccountStore {
6+
class LoginTokenStore implements TokenStore {
77
protected $token = null;
88
protected $username, $password, $totp, $apiBase;
99

Atomx/ReportStreamer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php namespace Atomx;
22

3-
use Atomx\AccountStore;
3+
use Atomx\TokenStore;
44
use GuzzleHttp\Stream\Stream;
55

66

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php namespace Atomx;
22

33

4-
interface AccountStore {
4+
interface TokenStore {
55
public function getToken();
66
public function storeToken($token);
77

88
public function getApiBase();
9-
}
9+
}

tests/ClientTest.php

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
<?php namespace tests;
22

3-
use Atomx\AccountStore;
3+
use Atomx\TokenStore;
44
use Atomx\Exceptions\ApiException;
55
use Atomx\Exceptions\TotpRequiredException;
6-
use Atomx\LoginAccountStore;
6+
use Atomx\LoginTokenStore;
77
use Atomx\Resources\Advertiser;
8-
use Atomx\Resources\Browsers;
98
use Atomx\Resources\Domain;
109
use Atomx\Resources\Login;
1110
use GuzzleHttp\Message\Response;
1211
use GuzzleHttp\Stream\Stream;
1312
use GuzzleHttp\Subscriber\History;
1413
use GuzzleHttp\Subscriber\Mock;
1514

16-
class TestAccountStore implements AccountStore {
15+
class TestTokenStore implements TokenStore {
1716
private $token = 'TEST_TOKEN';
1817

1918
public function getToken() { return $this->token; }
@@ -23,7 +22,7 @@ public function getPassword() { return ''; }
2322
public function getApiBase() { return 'https://api.atomx.com/v3/'; }
2423
}
2524

26-
class TestLoginAccountStore extends LoginAccountStore {
25+
class TestLoginTokenStore extends LoginTokenStore {
2726
private $loginClient;
2827
public function setLoginClient($client) { $this->loginClient = $client; }
2928
protected function getLoginClient() { return $this->loginClient; }
@@ -41,7 +40,7 @@ public function testTokenEndpointWithoutAS()
4140

4241
public function testDiscardInvalidToken()
4342
{
44-
$store = new TestAccountStore();
43+
$store = new TestTokenStore();
4544
$advertiser = new Advertiser($store);
4645

4746
$mock = new Mock([
@@ -59,7 +58,7 @@ public function testDiscardInvalidToken()
5958

6059
public function testRequestWithoutLogin()
6160
{
62-
$store = new TestAccountStore();
61+
$store = new TestTokenStore();
6362
$domain = new Domain($store);
6463

6564
$history = new History();
@@ -75,7 +74,7 @@ public function testRequestWithoutLogin()
7574

7675
public function testRequestWithAuthToken()
7776
{
78-
$store = new TestAccountStore();
77+
$store = new TestTokenStore();
7978
$advertiser = new Advertiser($store);
8079

8180
$history = new History();
@@ -92,9 +91,9 @@ public function testRequestWithAuthToken()
9291

9392
public function testLogin()
9493
{
95-
$login = new Login(new TestAccountStore);
94+
$login = new Login(new TestTokenStore);
9695

97-
$store = new TestLoginAccountStore();
96+
$store = new TestLoginTokenStore();
9897
$store->setLoginClient($login);
9998

10099
$advertiser = new Advertiser($store);
@@ -122,9 +121,9 @@ public function testLogin()
122121

123122
public function testTotpAccountStore()
124123
{
125-
$login = new Login(new TestAccountStore);
124+
$login = new Login(new TestTokenStore);
126125

127-
$store = new TestLoginAccountStore();
126+
$store = new TestLoginTokenStore();
128127
$store->setLoginClient($login);
129128

130129
$advertiser = new Advertiser($store);

0 commit comments

Comments
 (0)