Completed
Push — master ( 674111...7ff602 )
by Fabian
02:10
created

LedgersInfoResponse::getLedgerInfos()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace HanischIt\KrakenApi\Model\LedgersInfo;
4
5
use HanischIt\KrakenApi\Calls\Shared\Model\LedgerInfoModel;
6
use HanischIt\KrakenApi\Model\ResponseInterface;
7
8
/**
9
 * Class LedgersInfoResponse
10
 * @package HanischIt\KrakenApi\Model\Trades
11
 */
12
class LedgersInfoResponse implements ResponseInterface
13
{
14
    /**
15
     * @var LedgerInfoModel[]
16
     */
17
    private $ledgerInfos;
18
19
    /**
20
     * @param array $result
21
     */
22 1
    public function manualMapping($result)
23
    {
24 1
        foreach ($result as $ledgerId => $ledger) {
25 1
            $this->ledgerInfos[] = new LedgerInfoModel(
26 1
                $ledgerId,
27 1
                $ledger['refid'],
28 1
                $ledger['time'],
29 1
                $ledger['type'],
30 1
                $ledger['aclass'],
31 1
                $ledger['asset'],
32 1
                $ledger['amount'],
33 1
                $ledger['fee'],
34 1
                $ledger['balance']
35 1
            );
36 1
        }
37 1
    }
38
39
    /**
40
     * @return LedgerInfoModel[]
41
     */
42 1
    public function getLedgerInfos()
43
    {
44 1
        return $this->ledgerInfos;
45
    }
46
47
48
}
49