tickerStreamHandler Convert WebSocket ticker data into array

$data = $this->tickerStreamHandler( $json );

@param $json object data to convert
@return array
514722
private function tickerStreamHandler(\stdClass $json)
    {
        return [
            "eventType" => $json->e,
            "eventTime" => $json->E,
            "symbol" => $json->s,
            "priceChange" => $json->p,
            "percentChange" => $json->P,
            "averagePrice" => $json->w,
            "prevClose" => $json->x,
            "close" => $json->c,
            "closeQty" => $json->Q,
            "bestBid" => $json->b,
            "bestBidQty" => $json->B,
            "bestAsk" => $json->a,
            "bestAskQty" => $json->A,
            "open" => $json->o,
            "high" => $json->h,
            "low" => $json->l,
            "volume" => $json->v,
            "quoteVolume" => $json->q,
            "openTime" => $json->O,
            "closeTime" => $json->C,
            "firstTradeId" => $json->F,
            "lastTradeId" => $json->L,
            "numTrades" => $json->n,
        ];
    }
1321592
private function decodeJSON($json)
    {
        $query = json_decode($json);

        if (json_last_error()) {
            throw new QBParseException('JSON parsing threw an error: '.json_last_error_msg());
        }

        if (!is_object($query)) {
            throw new QBParseException('The query is not valid JSON');
        }

        return $query;
    }
230037
public function fromJson($json) {
    Helpers::checkType('json', 'string', $json);
    $decoded_value = json_decode($json);
    if ($decoded_value === null && ($json !== 'null' || $json !== '')) {
      throw new \Exception('Invalid JSON.');
    }
    return $this->setValue($decoded_value);
  }
816173
public static function fromJson($json)
    {
        $object = json_decode($json);

        $sale = new Sale();
        $sale->populate($object);

        return $sale;
    }
540145
public function decode(string $json): array
    {
        $decoded = \json_decode($json, true);
        if (\json_last_error() !== JSON_ERROR_NONE) {
            throw new DecodingException(\json_last_error_msg(), \json_last_error());
        }
        return $decoded;
    }
884986
private function parseJson($json)
    {
        $jsonPayload = json_decode($json, true);

        if (JSON_ERROR_NONE !== json_last_error()) {
            throw new ParserException('Error parsing JSON: '
                . json_last_error_msg());
        }

        return $jsonPayload;
    }
913355
public function toHtml(string $json)
    {
        if (empty($this->view)) {
            $this->view = 'sirtrevorjs::html';
        }

        $this->output = 'html';

        return $this->convert($json);
    }
1336134
public static function moSms($json)
    {
        $fields = Deserialize::_fromJson($json);
        return Deserialize::_moSmsFromFields($json, $fields);
    }
635125
public function deserializeCollection(string $json): CollectionWrapperInterface
    {
        try {
            /** @var CollectionWrapperInterface $collectionWrapper */
            $collectionWrapper = $this->jms()->deserialize(
                $json,
                $this->collectionWrapperClass(),
                'json'
            );
        } catch (\Exception $e) {
            throw new \RuntimeException('Error while deserialize "' . $json . '"', 0, $e);
        }


        return $collectionWrapper;
    }
1249048
public static function fromJson($json){
    if(is_string($json)){
      $json = json_decode($json);
    }
    
    if(!property_exists($json, 'total')){
      throw new BadResponseException('Required parameter "total" not found');
    }
    if(!property_exists($json, 'fns_site')){
      throw new BadResponseException('Required parameter "fns_site" not found');
    }
    if(!property_exists($json, 'fn_number')){
      throw new BadResponseException('Required parameter "fn_number" not found');
    }
    if(!property_exists($json, 'shift_number')){
      throw new BadResponseException('Required parameter "shift_number" not found');
    }
    if(!property_exists($json, 'receipt_datetime')){
      throw new BadResponseException('Required parameter "receipt_datetime" not found');
    }
    if(!property_exists($json, 'fiscal_receipt_number')){
      throw new BadResponseException('Required parameter "fiscal_receipt_number" not found');
    }
    if(!property_exists($json, 'fiscal_document_number')){
      throw new BadResponseException('Required parameter "fiscal_document_number" not found');
    }
    if(!property_exists($json, 'fiscal_document_attribute')){
      throw new BadResponseException('Required parameter "fiscal_document_attribute" not found');
    }
    if(!property_exists($json, 'ecr_registration_number')){
      throw new BadResponseException('Required parameter "ecr_registration_number" not found');
    }

    return new self(
      $json->total,
      $json->fns_site,
      $json->fn_number,
      $json->shift_number,
      new DateTime($json->receipt_datetime),
      $json->fiscal_receipt_number,
      $json->fiscal_document_number,
      $json->fiscal_document_attribute,
      $json->ecr_registration_number
    );
  }
623138
public static function groupResponse($json)
    {
        $fields = Deserialize::_fromJson($json);
        return Deserialize::_groupResponseFromFields($json, $fields);
    }
527727
public function fromSqlJson($json, Provider $provider = null) : array
    {
        if ($json === null) {
            return [];
        }

        return json_decode($json, true);
    }
32739
function jsonSerialize()
    {
        return [
            'success' => $this->success,
            'message' => $this->message,
            'error'   => $this->getError(),
            'data'    => SerializerBuilder::create()->build()->serialize(
                $this->data,
                'json',
                SerializationContext::create()->setGroups($this->groups)
            ),
        ];
    }
816363
public function toHtml($json)
    {
        // convert the json to an associative array
        $input = json_decode($json, true);
        $html = '';

        // loop trough the data blocks
        foreach ($input['data'] as $block) {
            $html .= $this->convert(new SirTrevorBlock($block['type'], $block['data']));
        }

        return $html;
    }
329487
public function fromJson( $json )
	{
		$this->__construct();
		$data	= json_decode( $json, TRUE );
		foreach( $this->types as $key => $value )
			if( isset( $data[$key] ) )
				$this->types[$key]	= $data[$key];
	}
25194
protected function _addQueryLogsNode($json)
    {
        $listener = $this->_getApiQueryLogListenerObject();
        $logs = $listener->getQueryLogs();

        if (empty($logs)) {
            return $json;
        }

        $result = json_decode($json, true);
        $result['query'] = $logs;

        return json_encode($result, JSON_PRETTY_PRINT);
    }
881100
public function toHtml($json)
    {
        $this->_buf = '';
        $this->_html($json);
        $buf = $this->_buf;
        unset($this->_buf);
        return $buf;
    }