Issues (51)

example/09_RecentTrades.php (2 issues)

Labels
Severity
1
<?php
2
/**
3
 * @author  Fabian Hanisch
4
 * @since   16.07.2017 02:55
5
 * @version 1.0
6
 */
7
require_once(__DIR__ . '/../vendor/autoload.php');
8
9
try {
10
    $api = new \HanischIt\KrakenApi\KrakenApi(
11
        "Your-API-Key",
12
        "Your-API-Sign"
13
    );
14
15
    $orderBookResponse = $api->getRecentTrades('XETHZEUR');
16
17
    echo "Last: " . date("Y-m-d H:i:s", $orderBookResponse->getLast());
0 ignored issues
show
The method getLast() does not exist on HanischIt\KrakenApi\Model\ResponseInterface. It seems like you code against a sub-type of HanischIt\KrakenApi\Model\ResponseInterface such as HanischIt\KrakenApi\Call...es\RecentTradesResponse or HanischIt\KrakenApi\Call\OHLCData\OHLCDataResponse or HanischIt\KrakenApi\Call...Data\SpreadDataResponse. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

17
    echo "Last: " . date("Y-m-d H:i:s", $orderBookResponse->/** @scrutinizer ignore-call */ getLast());
Loading history...
18
    foreach ($orderBookResponse->getTradeModel('XETHZEUR') as $tradeModel) {
0 ignored issues
show
The method getTradeModel() does not exist on HanischIt\KrakenApi\Model\ResponseInterface. It seems like you code against a sub-type of HanischIt\KrakenApi\Model\ResponseInterface such as HanischIt\KrakenApi\Call...es\RecentTradesResponse. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
    foreach ($orderBookResponse->/** @scrutinizer ignore-call */ getTradeModel('XETHZEUR') as $tradeModel) {
Loading history...
19
        echo "Time: " . date(
20
                "Y-m-d H:i:s",
21
                $tradeModel->getTime()
22
            ) . " / Type: " . $tradeModel->getType() . " / Price: " . $tradeModel->getPrice() . " / Volume: " . $tradeModel->getVolume() . "\n";
23
    }
24
} catch (Exception $e) {
25
    echo $e->getMessage();
26
}
27