Completed
Push — master ( 371a9b...ee3472 )
by Fabian
02:23
created

TradesResponse::manualMapping()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 2
Ratio 50 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 1
dl 2
loc 4
ccs 3
cts 3
cp 1
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace HanischIt\KrakenApi\Model\Trades;
4
5
use HanischIt\KrakenApi\Model\ResponseInterface;
6
use HanischIt\KrakenApi\Model\TradesHistory\Trade;
7
8
/**
9
 * Class TradesResponse
10
 * @package HanischIt\KrakenApi\Model\Trades
11
 */
12
class TradesResponse implements ResponseInterface
13
{
14
    /**
15
     * @var Trade[]
16
     */
17
    private $trades;
18
19
    /**
20
     * @param array $result
21
     */
22 1
    public function manualMapping($result)
23
    {
24 1 View Code Duplication
        foreach ($result as $txId => $trade) {
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->trades[] = new Trade($trade["ordertxid"], $trade["pair"], $trade["time"], $trade["type"], $trade["ordertype"], $trade["price"], $trade["cost"], $trade["fee"], $trade["vol"], $trade["margin"], $trade["misc"], $trade["closing"]);
26 1
        }
27 1
    }
28
29
    /**
30
     * @return Trade[]
31
     */
32 1
    public function getTrades()
33
    {
34 1
        return $this->trades;
35
    }
36
37
38
}
39