Total Complexity | 4 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | trait Accounts |
||
9 | { |
||
10 | /** |
||
11 | * An account ID to use. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $account; |
||
16 | |||
17 | /** |
||
18 | * Get a list of accounts for the current user. |
||
19 | * |
||
20 | * @return \Illuminate\Support\Collection|\Amelia\Monzo\Models\Account[] |
||
21 | */ |
||
22 | public function accounts() |
||
23 | { |
||
24 | $results = $this->call('GET', 'accounts', [], [], 'accounts'); |
||
25 | |||
26 | return collect($results)->map(function ($item) { |
||
27 | return new Account($item, $this); |
||
28 | }); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Get an existing account ID. |
||
33 | * |
||
34 | * @return string |
||
35 | */ |
||
36 | protected function getAccountId() |
||
53 | } |
||
54 | } |
||
55 |