Completed
Push — master ( 39a0bd...0a53a0 )
by Fabian
02:26
created

AccountBalanceResponse   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 23
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A manualMapping() 0 4 2
A getBalanceModels() 0 3 1
1
<?php
2
3
namespace HanischIt\KrakenApi\Call\AccountBalance;
4
5
use HanischIt\KrakenApi\Call\AccountBalance\Model\AccountBalanceModel;
6
use HanischIt\KrakenApi\Model\ResponseInterface;
7
8
/**
9
 * Class AccountBalanceResponse
10
 *
11
 * @package HanischIt\KrakenApi\Mod
12
 */
13
class AccountBalanceResponse implements ResponseInterface
14
{
15
    /**
16
     * @var AccountBalanceModel[]
17
     */
18
    private $balanceModels = [];
19
20
    /**
21
     * @param $result
22
     */
23 1
    public function manualMapping($result)
24
    {
25 1
        foreach ($result as $assetName => $balance) {
26 1
            $this->balanceModels[] = new AccountBalanceModel($assetName, $balance);
27 1
        }
28 1
    }
29
30
    /**
31
     * @return AccountBalanceModel[]
32
     */
33 1
    public function getBalanceModels()
34
    {
35 1
        return $this->balanceModels;
36
    }
37
}
38