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