| Total Complexity | 4 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class Accounts |
||
| 6 | { |
||
| 7 | const ENDPOINT = 'accounts'; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * @var Client |
||
| 11 | */ |
||
| 12 | private $client; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Account constructor. |
||
| 16 | * @param Client $client |
||
| 17 | */ |
||
| 18 | public function __construct(Client $client) |
||
| 19 | { |
||
| 20 | $this->client = $client; |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @see https://revolutdev.github.io/business-api/#get-accounts |
||
| 25 | * |
||
| 26 | * @return mixed |
||
| 27 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
| 28 | */ |
||
| 29 | public function all() |
||
| 30 | { |
||
| 31 | return $this->client->get(self::ENDPOINT); |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @see https://revolutdev.github.io/business-api/#get-account |
||
| 36 | * |
||
| 37 | * @param string $id |
||
| 38 | * @return mixed |
||
| 39 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
| 40 | */ |
||
| 41 | public function get(string $id) |
||
| 42 | { |
||
| 43 | return $this->client->get(self::ENDPOINT.'/'.$id); |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @see https://revolutdev.github.io/business-api/#get-account-details |
||
| 48 | * |
||
| 49 | * @param string $id |
||
| 50 | * @return mixed |
||
| 51 | * @throws \GuzzleHttp\Exception\GuzzleException |
||
| 52 | */ |
||
| 53 | public function getDetails(string $id) |
||
| 56 | } |
||
| 57 | } |
||
| 58 |