Hanisch-IT /
kraken-api
| 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
Bug
introduced
by
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
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 |