@@ -36,6 +36,6 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | public function getMessage($responseCode) |
| 38 | 38 | { |
| 39 | - return $this->messages[$responseCode]; |
|
| 39 | + return $this->messages[ $responseCode ]; |
|
| 40 | 40 | } |
| 41 | 41 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * |
| 64 | 64 | * @var array |
| 65 | 65 | */ |
| 66 | - protected $metadata = []; |
|
| 66 | + protected $metadata = [ ]; |
|
| 67 | 67 | |
| 68 | 68 | /** |
| 69 | 69 | * Balance. |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * |
| 78 | 78 | * @var array |
| 79 | 79 | */ |
| 80 | - protected $attachments = []; |
|
| 80 | + protected $attachments = [ ]; |
|
| 81 | 81 | |
| 82 | 82 | /** |
| 83 | 83 | * Category. |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | * @var Accounts\Account[] |
| 16 | 16 | * @JMS\Type("array<Thepixeldeveloper\Mondo\Response\Account>") |
| 17 | 17 | */ |
| 18 | - protected $accounts = []; |
|
| 18 | + protected $accounts = [ ]; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * @return Accounts\Account[] |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | * @var Transaction[] |
| 19 | 19 | * @JMS\Type("array<\Thepixeldeveloper\Mondo\Response\Transactions\Transaction>") |
| 20 | 20 | */ |
| 21 | - protected $transactions = []; |
|
| 21 | + protected $transactions = [ ]; |
|
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * @return Transactions\Transaction[] |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | * |
| 42 | 42 | * @return \Psr\Http\Message\ResponseInterface |
| 43 | 43 | */ |
| 44 | - public function get($uri, $options = []) |
|
| 44 | + public function get($uri, $options = [ ]) |
|
| 45 | 45 | { |
| 46 | 46 | return $this->guzzleClient->request('GET', $uri, $options); |
| 47 | 47 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | * |
| 18 | 18 | * @return mixed |
| 19 | 19 | */ |
| 20 | - public function get($uri, $options = []); |
|
| 20 | + public function get($uri, $options = [ ]); |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * @param ResponseInterface $data |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | public function getTransaction($transactionId) |
| 35 | 35 | { |
| 36 | 36 | return $this->client->deserializeResponse( |
| 37 | - $this->client->get('/transactions/' . $transactionId), |
|
| 37 | + $this->client->get('/transactions/'.$transactionId), |
|
| 38 | 38 | Response\Transactions\Transaction::class |
| 39 | 39 | ); |
| 40 | 40 | } |
@@ -70,13 +70,13 @@ discard block |
||
| 70 | 70 | public function addAnnotationForTransaction($transactionId, $key, $value = null) |
| 71 | 71 | { |
| 72 | 72 | if (is_string($key)) { |
| 73 | - $metadata = [$key => $value]; |
|
| 73 | + $metadata = [ $key => $value ]; |
|
| 74 | 74 | } else { |
| 75 | 75 | $metadata = $key; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - return $this->client->get('/transactions/' . $transactionId, [ |
|
| 79 | - 'body' => ['metadata' => $metadata], |
|
| 78 | + return $this->client->get('/transactions/'.$transactionId, [ |
|
| 79 | + 'body' => [ 'metadata' => $metadata ], |
|
| 80 | 80 | ]); |
| 81 | 81 | } |
| 82 | 82 | |
@@ -91,13 +91,13 @@ discard block |
||
| 91 | 91 | public function removeAnnotationForTransaction($transactionId, $keys) |
| 92 | 92 | { |
| 93 | 93 | if (is_string($keys)) { |
| 94 | - $keys = [$keys]; |
|
| 94 | + $keys = [ $keys ]; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | $keys = array_flip($keys); |
| 98 | 98 | |
| 99 | - return $this->client->get('/transactions/' . $transactionId, [ |
|
| 100 | - 'body' => ['metadata' => $keys], |
|
| 99 | + return $this->client->get('/transactions/'.$transactionId, [ |
|
| 100 | + 'body' => [ 'metadata' => $keys ], |
|
| 101 | 101 | ]); |
| 102 | 102 | } |
| 103 | 103 | } |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | return (new \GuzzleHttp\Client([ |
| 69 | 69 | 'base_uri' => $this->getBaseUrl(), |
| 70 | 70 | 'headers' => [ |
| 71 | - 'Authorization' => 'Bearer ' . $this->getAccessToken(), |
|
| 71 | + 'Authorization' => 'Bearer '.$this->getAccessToken(), |
|
| 72 | 72 | ], |
| 73 | 73 | ])); |
| 74 | 74 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require_once __DIR__ . '/../vendor/autoload.php'; |
|
| 3 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
| 4 | 4 | |
| 5 | 5 | use Doctrine\Common\Annotations\AnnotationRegistry; |
| 6 | 6 | use JMS\Serializer\SerializerBuilder; |
@@ -36,14 +36,14 @@ discard block |
||
| 36 | 36 | $outputBlock('Your user ID: ', $ping->whoAmI()->getUserId()); |
| 37 | 37 | |
| 38 | 38 | $accounts = new Mondo\Client\Accounts($client); |
| 39 | -$accountId = $accounts->getAccounts()->getAccounts()[0]->getId(); |
|
| 39 | +$accountId = $accounts->getAccounts()->getAccounts()[ 0 ]->getId(); |
|
| 40 | 40 | $outputBlock('Your first account ID: ', $accountId); |
| 41 | 41 | |
| 42 | 42 | $balance = new Mondo\Client\Balance($client); |
| 43 | 43 | $outputBlock('Your balance: ', $balance->getBalanceForAccountId($accountId)->getBalance()); |
| 44 | 44 | |
| 45 | 45 | $transactions = new Mondo\Client\Transactions($client); |
| 46 | -$transactionId = $transactions->getTransactionsForAccountId($accountId)->getTransactions()[0]->getId(); |
|
| 46 | +$transactionId = $transactions->getTransactionsForAccountId($accountId)->getTransactions()[ 0 ]->getId(); |
|
| 47 | 47 | |
| 48 | 48 | $outputBlock('How many transactions you\'ve made: ', count($transactions->getTransactionsForAccountId($accountId)->getTransactions())); |
| 49 | 49 | $outputBlock('First transaction: ', $transactions->getTransaction($transactionId)->getDescription()); |