Issues (51)

example/12_OHLCData.php (2 issues)

Labels
Severity
1
<?php
2
3
require_once(__DIR__ . '/../vendor/autoload.php');
4
5
try {
6
    $api = new \HanischIt\KrakenApi\KrakenApi(
7
        "Your-API-Key",
8
        "Your-API-Sign"
9
    );
10
11
    $ohlcResponse = $api->getOHLCData('XETHZEUR');
12
13
    echo "last: " . date("Y-m-d H:i:s", $ohlcResponse->getLast()) . "\n";
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

13
    echo "last: " . date("Y-m-d H:i:s", $ohlcResponse->/** @scrutinizer ignore-call */ getLast()) . "\n";
Loading history...
14
15
    foreach ($ohlcResponse->getOhlcDataModels() as $ohlcDataModel) {
0 ignored issues
show
The method getOhlcDataModels() 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\OHLCData\OHLCDataResponse. ( Ignorable by Annotation )

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

15
    foreach ($ohlcResponse->/** @scrutinizer ignore-call */ getOhlcDataModels() as $ohlcDataModel) {
Loading history...
16
        echo date("Y-m-d H:i:s",
17
                $ohlcDataModel->getTime()) . ": High: " . $ohlcDataModel->getHigh() . " / Low: " . $ohlcDataModel->getLow() . "\n";
18
    }
19
20
21
} catch (Exception $e) {
22
    echo $e->getMessage();
23
}
24