Parse the dirty google data response.

@var \Google_Service_Analytics_GaData results

@return array
492559
public function parseResult($results)
    {
        $simpleDataTable = $results->getDataTable()->toSimpleObject();

        foreach ($simpleDataTable->cols as $col) {
            $cols[] = $col['label'];
        }

        foreach ($simpleDataTable->rows as $row) {
            foreach ($row['c'] as $key => $value) {
                $rowData[$cols[$key]] = $value['v'];
            }

            $rows[] = $rowData;

            unset($rowData);
        }

        return [
            'cols' => $cols,
            'rows' => $rows,
        ];
    }
1279972
public function getBodyAttributes()
    {
        $attributes = [];
        
        $api = GoogleAPI::singleton();
        
        if ($key = $api->getAPIKey()) {
            $attributes['data-google-api-key'] = $key;
        }
        
        if ($lang = $api->getAPILanguage()) {
            $attributes['data-google-api-lang'] = $lang;
        }
        
        if ($api->isAnalyticsEnabled()) {
            $attributes['data-google-tracking-id'] = $api->getAnalyticsTrackingID();
        }
        
        return $attributes;
    }
1095079
protected function parseTransactionDescription()
    {
        $results = [];
        if (preg_match_all('/[\n]:86:(.*?)(?=\n(:6([12]))|$)/s', $this->getCurrentTransactionData(), $results)
            && !empty($results[1])
        ) {
            return $this->sanitizeDescription(implode(PHP_EOL, $results[1]));
        }

        return '';
    }
1243029
private function ParseDataFromPhpInput() {
        if (file_get_contents('php://input') == "") {
            return array();
        }
        $jsonDecodedData = json_decode(file_get_contents('php://input'));
        if (is_null($jsonDecodedData)) {
            return array();
        }
        $postData = get_object_vars($jsonDecodedData);
        if (empty($postData)) {
            return array();
        }
        return $postData;
    }
456213
public function getData()
    {
        $result = [
            'type' => $this->type
        ];

        switch($this->type)
        {

            case self::TYPE_WEB:
              $result['url'] = $this->url;

              if ($this->webview_height_ratio) {
                  $result['webview_height_ratio'] = $this->webview_height_ratio;
              }

              if ($this->messenger_extensions){
                  $result['messenger_extensions'] = $this->messenger_extensions;
                  $result['fallback_url'] = $this->fallback_url;
              }
            break;

        }

        return $result;
    }
829084
public function getResults()
    {
        // Get request data from request handler
        $request = $this->getRequestHandler()->getRequest();

        $searchTerms = $request->requestVar('Search');
        $query = SearchQuery::create()->addSearchTerm($searchTerms);

        if ($start = $request->requestVar('start')) {
            $query->setStart($start);
        }

        $params = [
            'spellcheck' => 'true',
            'spellcheck.collate' => 'true',
        ];

        // Get the first index
        $indexClasses = FullTextSearch::get_indexes(SolrIndex::class);
        $indexClass = reset($indexClasses);

        /** @var SolrIndex $index */
        $index = $indexClass::singleton();
        $results = $index->search($query, -1, -1, $params);

        // filter by permission
        if ($results) {
            foreach ($results->Matches as $match) {
                /** @var DataObject $match */
                if (!$match->canView()) {
                    $results->Matches->remove($match);
                }
            }
        }
        return $results;
    }
507800
public function getData()
    {
        if ($this->data === null) {
            $searchRequest  = $this->searchRequestBuilder->getRequest();
            $searchResponse = $this->searchEngine->search($searchRequest);

            $this->data = $this->processResponse($searchResponse);
        }

        return $this->data;
    }
1028601
public function getData()
    {
        try {
            $this->parse();
            $organized_statements = array();
            foreach ($this->dependencies as $name=>$preset) {
                foreach ($preset->getStatements() as $type=>$statements) {
                    if (!isset($organized_statements[$type])) {
                        $organized_statements[$type] = array();
                    }
                    foreach ($statements as $statement) {
                        $organized_statements[$type][] = $statement;
                    }
                }
            }
            foreach ($organized_statements as $type=>$stacks) {
                $organized_statements[$type] = $preset->getOrderedStatements($stacks);
            }
        } catch (\Exception $e) {
            throw $e;
        }
        return $organized_statements;
    }
1280779
public function getArray()
  {
    $errors = empty($this->errors) ? null : $this->errors;

    $response = array(
        'status' => $this->getStatus(),
        'data'   => $this->data,
        'errors' => $errors,
    );

    if (!is_null($this->code)) {
      $response['code'] = $this->code;
    }

    if (!is_null($this->message)) {
      $response['message'] = $this->message;
    }

    return $response;
  }
35674
public function get_array() {
	$response = array();
	
	// links
	if ($this->links) {
		$response['links'] = $this->links;
	}
	
	// primary data
	$response['data'] = $this->primary_collection;
	
	// included resources
	if ($this->included_data) {
		$response['included'] = array_values($this->included_data);
	}
	
	// meta data
	if ($this->meta_data) {
		$response['meta'] = $this->meta_data;
	}
	
	return $response;
}
123965
public function parse()
    {
        if ($this->query !== null) {
            return $this->query;
        }
        $query = preg_replace_callback('~{(.*?)}~', array($this, 'tableClb'), $this->pattern);
        $pattern = '~\?([a-z\?-]+)?(:([a-z0-9_-]*))?;?~i';
        $callback = array($this, 'placeholderClb');
        $query = preg_replace_callback($pattern, $callback, $query);
        if ((!$this->named) && (count($this->data) > $this->counter)) {
            if (($this->counter > 0) || (isset($this->data[0]))) {
                throw new DataMuch(count($this->data), $this->counter);
            }
        }
        $this->query = $query;
        return $this->query;
    }
532423
public function parseData(): self
    {
        if (!is_array($this->raw_data)) {
            throw new RuntimeException('Response must be an array');
        }

        if (!array_key_exists('status', $this->raw_data)) {
            $this->result_code = ResponseInterface::RESULT_DATA_MALFORMED;

            return $this;
        }

        $this->result_code = $this->raw_data['status'];

        // ios > 7 receipt validation
        if ($this->isIOS7StyleReceipt()) {
            $this->parseIOS7StyleReceipt();
        } elseif ($this->isIOS6StyleReceipt()) {
            $this->parseIOS6StyleReceipt();
        }

        return $this;
    }
765354
public function getErrorDataFromResponse()
    {
        $aErrorData = array();
        $aResponse  = (array) $this->getResponse();

        foreach ( $aResponse as $sKey => $sValue ) {
            if ( mb_strpos( $sKey, 'error_', null, 'UTF-8' ) === 0 ) {
                $aErrorData[$sKey] = $sValue;
            }
        }

        return $aErrorData;
    }
51803
public function parseData(): self
    {
        if (!is_array($this->raw_data)) {
            throw new RunTimeException('Response must be a scalar value');
        }

        $this->product_id = $this->raw_data['product_id'];
        $this->original_transaction_id = $this->raw_data['original_transaction_id'];
        $this->auto_renew_product_id = $this->raw_data['auto_renew_product_id'];
        $this->auto_renew_status = (bool)$this->raw_data['auto_renew_status'];

        if (array_key_exists('expiration_intent', $this->raw_data)) {
            $this->expiration_intent = (int)$this->raw_data['expiration_intent'];
        }

        if (array_key_exists('is_in_billing_retry_period', $this->raw_data)) {
            $this->is_in_billing_retry_period = (int)$this->raw_data['is_in_billing_retry_period'];
        }

        return $this;
    }
10480
public function getData()
	{
		$data = $this->data;

		foreach ($data as $key => $value)
		{
			if (is_object($value) and $this->isWhitelisted($value))
			{
				continue;
			}

			if ($this->shouldBeFiltered($key))
			{
				if ($value instanceof Sanitize)
				{
					$data[$key] = $value->sanitize();
				}
				else
				{
					$data[$key] = $this->filter($value);
				}
			}
		}

		return $data;
	}
1354636
protected function parseExistingCookie()
    {
        if (is_array($this->data)) {
            return;
        }

        $cookiesContent = filter_input_array(INPUT_COOKIE);

        if (empty($cookiesContent) || !array_key_exists($this->cookieName, $cookiesContent)) {
            $this->data = [];
            return;
        }

        $deserializedCookie = json_decode($cookiesContent[$this->cookieName], true);

        if (is_null($deserializedCookie)) {
            $this->data = [];
            return;
        }

        $this->data = $deserializedCookie;
    }
812799
public function getDiagnosisData()
    {
        if (! isset($this->_gemsData['gec_diagnosis'])) {
            return [];
        }
        if (is_string($this->_gemsData['gec_diagnosis'])) {
            $this->_gemsData['gec_diagnosis'] = json_decode($this->_gemsData['gec_diagnosis'], true);
        }

        return $this->_gemsData['gec_diagnosis'];
    }