Parse Apache Information lines to get valid values.
@param array|null $data Array of lines to parse.
337552
private function parseApacheInfo(array $data = null)
    {
        $this->apache_info = null;

        if (is_array($data) && count($data) > 0) {
            foreach ($data as $line) {
                $this->interpretApacheInfoData($line) ||
                $this->interpretApacheInfoVariable($line);
            }
        }
    }
1061740
protected function prepareData($data)
    {
        $callback = function ($value) {
            return $value !== null && $value !== [] && $value !== '';
        };

        foreach ($data as &$value) {
            if (is_array($value)) {
                $value = $this->prepareData($value);
            }
        }
        return array_filter($data, $callback);
    }
1194675
public function parseData(array $data)
    {
        $newData = [];

        foreach ($data as $key => $value) {
            if (is_array($value)) {
                $value = $this->parseData($value);
            }

            // If the data key contains a dot, we will replace it with another character
            // sequence so it doesn't interfere with dot processing when working with
            // array based validation rules and array_dot later in the validations.
            if (Str::contains($key, '.')) {
                $newData[str_replace('.', '->', $key)] = $value;
            } else {
                $newData[$key] = $value;
            }
        }

        return $newData;
    }
1266749
public function parseReadData($data)
	{
		$results = array();

		foreach ($data as $row) {
			if (is_array($row)) {
				$key = $row['key'];
				$value = $row['value'];
			} elseif (is_object($row)) {
				$key = $row->key;
				$value = $row->value;
			} else {
				$msg = 'Expected array or object, got '.gettype($row);
				throw new \UnexpectedValueException($msg);
			}

			SettingsUtilities::set($results, $key, $value);
		}

		return $results;
	}
1348448
private function parseDocument(array $data)
    {
        $result = null;

        $dataSegment = $this->getArrayValue($data, DocumentInterface::KEYWORD_DATA, null);
        if (empty($dataSegment) === false && is_array($dataSegment) === true) {
            $isProbablySingle = $this->isProbablySingleIdentity($dataSegment);
            $parsed           = $isProbablySingle === true ?
                $this->parseSinglePrimaryData($dataSegment) :
                $this->parseArrayOfPrimaryData($dataSegment);

            if ($parsed !== null) {
                $result = new DocumentObject($parsed);
            }
        } elseif ($dataSegment !== null) {
            $this->errors->addDataError('Invalid element.');
        }

        return $result;
    }
123320
public function getFieldValues(array $data) : array
    {
        $result = [];
        foreach ($this->getFields() as $field) {
            $result[$field] = array_key_exists($field, $data) ? $data[$field] : null;
        }

        return $result;
    }
1039868
static function decodeElementRawData(string $data): ?array
    {
        $data = json_decode($data, true);
        if (is_array($data) &&
                isset($data['id']) && is_string($data['id']) && strlen($data['id']) > 0 &&
                isset($data['type']) && is_string($data['type']) && strlen($data['type']) > 0 &&
                isset($data['data']) && is_array($data['data'])
        ) {
            return $data;
        }
        return null;
    }
94752
public static function parseData($data)
    {
        $parsed = array();
        foreach (explode(' ', $data) as $pair) {
            if (strpos($pair, ':') > 0) {
                list($key, $value) = array_map('trim', explode(':', $pair));
                $parsed[$key] = $value;
            }
        }

        return $parsed;
    }
817378
private function parse(array $data)
    {
        $result = array();

        foreach ($data as $index => $array) {
            if ($this->serializer->isSerialized($array[ConstProviderInterface::CACHE_PARAM_VALUE])) {
                $array[ConstProviderInterface::CACHE_PARAM_VALUE] = $this->serializer->unserialize($array[ConstProviderInterface::CACHE_PARAM_VALUE]);
            }

            $result[$array[ConstProviderInterface::CACHE_PARAM_KEY]] = array(
                ConstProviderInterface::CACHE_PARAM_VALUE => $array[ConstProviderInterface::CACHE_PARAM_VALUE], 
                ConstProviderInterface::CACHE_PARAM_TTL => $array[ConstProviderInterface::CACHE_PARAM_TTL], 
                ConstProviderInterface::CACHE_PARAM_CREATED_ON => $array[ConstProviderInterface::CACHE_PARAM_CREATED_ON]
            );
        }

        return $result;
    }
183322
public function populate($data = array())
    {
        $this->appId = (isset($data['appId'])) ? $data['appId'] : null;
        $this->appSecret = (isset($data['appSecret'])) ? $data['appSecret'] : null;

    }
288138
public function parse($data, $key = null)
    {
        if ($key) $this->apiKey = $key;
        return $this->get($data, [], null, 'parse');
    }
279341
public function parse($data)
    {
        $result = array();
        $parts = explode("\n", $data);

        foreach($parts as $index => $part) {
            $kv = explode("=", $part);
            if (!empty($kv[1])) {
                $result[$kv[0]] = $kv[1];
            }
        }

        $this->load($result);
    }
796706
public function parseReadData($data)
	{
		$results = array();

		foreach ($data as $row) {
			if (is_array($row)) {
				$key = $row[$this->keyColumn];
				$value = $row[$this->valueColumn];
			} elseif (is_object($row)) {
				$key = $row->{$this->keyColumn};
				$value = $row->{$this->valueColumn};
			} else {
				$msg = 'Expected array or object, got '.gettype($row);
				throw new \UnexpectedValueException($msg);
			}

			ArrayUtil::set($results, $key, $value);
		}

		return $results;
	}
243352
private function parseSingleRelationship($data)
    {
        if ($data === null) {
            $result = null;
        } elseif (is_array($data) === true &&
            array_key_exists(DI::KEYWORD_TYPE, $data) === true &&
            array_key_exists(DI::KEYWORD_ID, $data) === true &&
            is_scalar($type = $data[DI::KEYWORD_TYPE]) === true &&
            is_scalar($index = $data[DI::KEYWORD_ID]) === true
        ) {
            $result = [$type => $index];
        } else {
            $result = false;
        }

        return $result;
    }
1186899
private function parseDataToString($data)
    {
        $format = $this->allowedFormats[$this->format];
        $className = "\\Ginger\\Response\\Format\\".$format['class'];
        return $className::Parse($data);

    }
179172
protected function parse($data = null, $filename = null)
    {
        // If we have a callable, run it and expect an array back
        if (is_callable($data)) {
            $data = call_user_func($data);
        }

        // Check for array, if its anything else, throw an exception
        if (!is_array($data)) {
            throw new UnsupportedFormatException('PHP data does not return an array');
        }

        return $data;
    }
852434
protected function parseValues($data)
    {
    	if (isset($data[0])) {
    		$set = $this->_parseDataItemToValues($data);
    	} else {
    		$set = $this->parse($data);
    	}
        
        foreach ($set as $v) {
            $group[] = '(' . implode(',', $v) . ')';
        }
        return empty($set) ? '' : 'VALUES '. implode(',', $group);
    }