Skip to content

Commit 28f00d4

Browse files
committed
private methods are now protected
1 parent 57a6af0 commit 28f00d4

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

php-binance-api.php

+25-25
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ class API
4646
protected $transfered = 0; // /< This stores the amount of bytes transfered
4747
protected $requestCount = 0; // /< This stores the amount of API requests
4848
protected $httpDebug = false; // /< If you enable this, curl will output debugging information
49-
private $subscriptions = []; // /< View all websocket subscriptions
50-
private $btc_value = 0.00; // /< value of available assets
51-
private $btc_total = 0.00;
49+
protected $subscriptions = []; // /< View all websocket subscriptions
50+
protected $btc_value = 0.00; // /< value of available assets
51+
protected $btc_total = 0.00;
5252

5353
// /< value of available onOrder assets
5454

5555
protected $exchangeInfo = NULL;
5656
protected $lastRequest = [];
5757

58-
private $xMbxUsedWeight = 0;
59-
private $xMbxUsedWeight1m = 0;
58+
protected $xMbxUsedWeight = 0;
59+
protected $xMbxUsedWeight1m = 0;
6060

6161
/**
6262
* Constructor for the class,
@@ -92,7 +92,7 @@ public function __construct()
9292
}
9393

9494
/**
95-
* magic get for private and protected members
95+
* magic get for protected and protected members
9696
*
9797
* @param $file string the name of the property to return
9898
* @return null
@@ -106,7 +106,7 @@ public function __get(string $member)
106106
}
107107

108108
/**
109-
* magic set for private and protected members
109+
* magic set for protected and protected members
110110
*
111111
* @param $member string the name of the member property
112112
* @param $value the value of the member property
@@ -124,7 +124,7 @@ public function __set(string $member, $value)
124124
* @param $file string file location
125125
* @return null
126126
*/
127-
private function setupApiConfigFromFile(string $file = null)
127+
protected function setupApiConfigFromFile(string $file = null)
128128
{
129129
$file = is_null($file) ? getenv("HOME") . "/.config/jaggedsoft/php-binance-api.json" : $file;
130130

@@ -149,7 +149,7 @@ private function setupApiConfigFromFile(string $file = null)
149149
* @param $file string file location
150150
* @return null
151151
*/
152-
private function setupCurlOptsFromFile(string $file = null)
152+
protected function setupCurlOptsFromFile(string $file = null)
153153
{
154154
$file = is_null($file) ? getenv("HOME") . "/.config/jaggedsoft/php-binance-api.json" : $file;
155155

@@ -172,7 +172,7 @@ private function setupCurlOptsFromFile(string $file = null)
172172
*
173173
* @return null
174174
*/
175-
private function setupProxyConfigFromFile(string $file = null)
175+
protected function setupProxyConfigFromFile(string $file = null)
176176
{
177177
$file = is_null($file) ? getenv("HOME") . "/.config/jaggedsoft/php-binance-api.json" : $file;
178178

@@ -1175,7 +1175,7 @@ public function candlesticks(string $symbol, string $interval = "5m", int $limit
11751175
* @param $priceData array of prices
11761176
* @return array containing the response
11771177
*/
1178-
private function balanceData(array $array, $priceData)
1178+
protected function balanceData(array $array, $priceData)
11791179
{
11801180
$balances = [];
11811181

@@ -1258,7 +1258,7 @@ private function balanceData(array $array, $priceData)
12581258
* @param $json array data to convert
12591259
* @return array
12601260
*/
1261-
private function balanceHandler(array $json)
1261+
protected function balanceHandler(array $json)
12621262
{
12631263
$balances = [];
12641264
foreach ($json as $item) {
@@ -1281,7 +1281,7 @@ private function balanceHandler(array $json)
12811281
* @param $json object data to convert
12821282
* @return array
12831283
*/
1284-
private function tickerStreamHandler(\stdClass $json)
1284+
protected function tickerStreamHandler(\stdClass $json)
12851285
{
12861286
return [
12871287
"eventType" => $json->e,
@@ -1318,7 +1318,7 @@ private function tickerStreamHandler(\stdClass $json)
13181318
* @param \stdClass $json object data to convert
13191319
* @return array
13201320
*/
1321-
private function executionHandler(\stdClass $json)
1321+
protected function executionHandler(\stdClass $json)
13221322
{
13231323
return [
13241324
"symbol" => $json->s,
@@ -1346,7 +1346,7 @@ private function executionHandler(\stdClass $json)
13461346
* @param $ticks array of the canbles array
13471347
* @return array object of the chartdata
13481348
*/
1349-
private function chartData(string $symbol, string $interval, array $ticks)
1349+
protected function chartData(string $symbol, string $interval, array $ticks)
13501350
{
13511351
if (!isset($this->info[$symbol])) {
13521352
$this->info[$symbol] = [];
@@ -1391,7 +1391,7 @@ private function chartData(string $symbol, string $interval, array $ticks)
13911391
* @param $trades array of trade information
13921392
* @return array easier format for trade information
13931393
*/
1394-
private function tradesData(array $trades)
1394+
protected function tradesData(array $trades)
13951395
{
13961396
$output = [];
13971397
foreach ($trades as $trade) {
@@ -1417,7 +1417,7 @@ private function tradesData(array $trades)
14171417
* @param $array array book prices
14181418
* @return array easier format for book prices information
14191419
*/
1420-
private function bookPriceData(array $array)
1420+
protected function bookPriceData(array $array)
14211421
{
14221422
$bookprices = [];
14231423
foreach ($array as $obj) {
@@ -1439,7 +1439,7 @@ private function bookPriceData(array $array)
14391439
* @param $array array of prices
14401440
* @return array of key/value pairs
14411441
*/
1442-
private function priceData(array $array)
1442+
protected function priceData(array $array)
14431443
{
14441444
$prices = [];
14451445
foreach ($array as $obj) {
@@ -1583,7 +1583,7 @@ public function displayDepth(array $array)
15831583
* @param $json array of the depth infomration
15841584
* @return array of the depth information
15851585
*/
1586-
private function depthData(string $symbol, array $json)
1586+
protected function depthData(string $symbol, array $json)
15871587
{
15881588
$bids = $asks = [];
15891589
foreach ($json['bids'] as $obj) {
@@ -1682,7 +1682,7 @@ public function addToTransfered(int $int)
16821682
* @param $json array of depth bids and asks
16831683
* @return null
16841684
*/
1685-
private function depthHandler(array $json)
1685+
protected function depthHandler(array $json)
16861686
{
16871687
$symbol = $json['s'];
16881688
if ($json['u'] <= $this->info[$symbol]['firstUpdate']) {
@@ -1715,7 +1715,7 @@ private function depthHandler(array $json)
17151715
* @param \stdClass $json object time
17161716
* @return null
17171717
*/
1718-
private function chartHandler(string $symbol, string $interval, \stdClass $json)
1718+
protected function chartHandler(string $symbol, string $interval, \stdClass $json)
17191719
{
17201720
if (!$this->info[$symbol][$interval]['firstOpen']) { // Wait for /kline to finish loading
17211721
$this->chartQueue[$symbol][$interval][] = $json;
@@ -2317,7 +2317,7 @@ public function bookTicker(callable $callback)
23172317
* This function downloads ca bundle for curl website
23182318
* and uses it as part of the curl options
23192319
*/
2320-
private function downloadCurlCaBundle()
2320+
protected function downloadCurlCaBundle()
23212321
{
23222322
$output_filename = getcwd() . "/ca.pem";
23232323

@@ -2361,17 +2361,17 @@ private function downloadCurlCaBundle()
23612361
fclose($fp);
23622362
}
23632363

2364-
private function floorDecimal($n, $decimals=2)
2364+
protected function floorDecimal($n, $decimals=2)
23652365
{
23662366
return floor($n * pow(10, $decimals)) / pow(10, $decimals);
23672367
}
23682368

23692369

2370-
private function setXMbxUsedWeight (int $usedWeight) : void {
2370+
protected function setXMbxUsedWeight (int $usedWeight) : void {
23712371
$this->xMbxUsedWeight = $usedWeight;
23722372
}
23732373

2374-
private function setXMbxUsedWeight1m (int $usedWeight1m) : void {
2374+
protected function setXMbxUsedWeight1m (int $usedWeight1m) : void {
23752375
$this->xMbxUsedWeight1m = $usedWeight1m;
23762376
}
23772377

0 commit comments

Comments
 (0)