Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Commit

Permalink
add addtional check for kline chart data
Browse files Browse the repository at this point in the history
  • Loading branch information
dmzoneill committed May 21, 2018
1 parent c500762 commit 3dce66e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions php-binance-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,16 @@ public function candlesticks(string $symbol, string $interval = "5m", int $limit
}

$response = $this->httpRequest("v1/klines", "GET", $opt);

if (is_array($response) === false) {
return [];
}

if (count($response) === 0) {
echo "warning: v1/klines returned empty array, usually a blip in the connection or server" . PHP_EOL;
return [];
}

$ticks = $this->chartData($symbol, $interval, $response);
$this->charts[$symbol][$interval] = $ticks;
return $ticks;
Expand Down

0 comments on commit 3dce66e

Please sign in to comment.