php-binance-api.php
private function depthHandler(array $json)
    {
        $symbol = $json['s'];
        if ($json['u'] <= $this->info[$symbol]['firstUpdate']) {
            return;
        }

        foreach ($json['b'] as $bid) {
            $this->depthCache[$symbol]['bids'][$bid[0]] = $bid[1];
            if ($bid[1] == "0.00000000") {
                unset($this->depthCache[$symbol]['bids'][$bid[0]]);
            }

        }
        foreach ($json['a'] as $ask) {
            $this->depthCache[$symbol]['asks'][$ask[0]] = $ask[1];
            if ($ask[1] == "0.00000000") {
                unset($this->depthCache[$symbol]['asks'][$ask[0]]);
            }

        }
    }
private function depthHandler(array $json)
    {
        $symbol = $json['s'];
        if ($json['u'] <= $this->info[$symbol]['firstUpdate']) {
            return;
        }

        foreach ($json['b'] as $bid) {
            $this->depthCache[$symbol]['bids'][$bid[0]] = $bid[1];
            if ($bid[1] == "0.00000000") {
                unset($this->depthCache[$symbol]['bids'][$bid[0]]);
            }

        }
        foreach ($json['a'] as $ask) {
            $this->depthCache[$symbol]['asks'][$ask[0]] = $ask[1];
            if ($ask[1] == "0.00000000") {
                unset($this->depthCache[$symbol]['asks'][$ask[0]]);
            }

        }
    }
private function depthHandler ( array $ json ) { $ symbol = $ json [ 's' ] ; if ( $ json [ 'u' ] <= $ this -> info [ $ symbol ] [ 'firstUpdate' ] ) { return ; } foreach ( $ json [ 'b' ] as $ bid ) { $ this -> depthCache [ $ symbol ] [ 'bids' ] [ $ bid [ 0 ] ] = $ bid [ 1 ] ; if ( $ bid [ 1 ] == "0.00000000" ) { unset ( $ this -> depthCache [ $ symbol ] [ 'bids' ] [ $ bid [ 0 ] ] ) ; } } foreach ( $ json [ 'a' ] as $ ask ) { $ this -> depthCache [ $ symbol ] [ 'asks' ] [ $ ask [ 0 ] ] = $ ask [ 1 ] ; if ( $ ask [ 1 ] == "0.00000000" ) { unset ( $ this -> depthCache [ $ symbol ] [ 'asks' ] [ $ ask [ 0 ] ] ) ; } } }
depthHandler For WebSocket Depth Cache

$this->depthHandler($json);

@param $json array of depth bids and asks
@return null
depthHandler For WebSocket Depth Cache