Passed
Push — master ( 80a2af...b754d5 )
by Fabian
51s
created

QueryLedgersResponse::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
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace HanischIt\KrakenApi\Call\QueryLedgers;
4
5
use HanischIt\KrakenApi\Call\Shared\Model\LedgerInfoModel;
6
use HanischIt\KrakenApi\Model\ResponseInterface;
7
8
/**
9
 * Class QueryLedgersResponse
10
 * @package HanischIt\KrakenApi\Call\QueryLedgers
11
 */
12
class QueryLedgersResponse 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 View Code Duplication
        foreach ($result as $ledgerId => $ledger) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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