| Conditions | 3 |
| Paths | 3 |
| Total Lines | 27 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function list(): Collection |
||
| 14 | { |
||
| 15 | $response = $this->performQuery('subaccounts/list'); |
||
| 16 | |||
| 17 | $subaccounts = collect(); |
||
| 18 | |||
| 19 | if (! isset($response['User'])) { |
||
| 20 | return $subaccounts; |
||
| 21 | } |
||
| 22 | |||
| 23 | if (isset($response['User']['Id'])) { |
||
| 24 | $subaccounts->push($response['User']); |
||
| 25 | } else { |
||
| 26 | $subaccounts = collect($response['User']); |
||
| 27 | } |
||
| 28 | |||
| 29 | $subaccounts->transform(function ($item, $key) { |
||
|
|
|||
| 30 | return new StatSubAccount([ |
||
| 31 | 'id' => $item['Id'], |
||
| 32 | 'login' => $item['Login'], |
||
| 33 | 'api_key' => $item['ApiKey'], |
||
| 34 | 'created_at' => $item['CreatedAt'], |
||
| 35 | ]); |
||
| 36 | }); |
||
| 37 | |||
| 38 | return $subaccounts; |
||
| 39 | } |
||
| 40 | } |
||
| 41 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.