@param array $data

@return array
429023
private function getLanguageOptions(array $data)
    {
        $options = new LanguageBag();

        foreach ($data as $key => $value) {
            if (substr($key, -8) == '-options') {
                $language = substr($key, 0, -8); // remove "-options"

                if (is_array($value)) {
                    $value = new LanguageBag($value);
                }

                $options->set($language, $value);
            }
        }

        return $options;
    }
544307
public function createRules(array $data): array
    {
        return array_map(function ($data) {
            if ($data instanceof Rule) {
                return $data;
            }

            return Rule::createFromData((array) $data);
        }, $data);
    }
605605
public function normalizeData(array $data): array
    {
        $normalizedMetaData = [];
        foreach ($data as $key => $value) {
            $normalizedKey = strtolower($key);
            $normalizedValue = $this->normalizeValues($normalizedKey, $value);
            $normalizedMetaData[$normalizedKey] = $normalizedValue;
        }

        return $normalizedMetaData;
    }
1105283
protected function rename(array $data): array
    {
        $result = [];
        foreach ($data as $dataItem) {
            list($keyId, $dataTmp) = $this->getKeyValue($dataItem);

            if ($keyId === null) {
                $result[] = $dataTmp;
            } else {
                $result[$keyId] = $dataTmp;
            }
        }

        return $result;
    }
1365219
protected function buildArray(array $data)
    {
        $insert_values = [];

        foreach ($data as $key => $value) {
            if ($value === null) {
                $insert_values[] = sprintf('%s => NULL', $this->escape($key));
            } else {
                $insert_values[] = sprintf(
                    '%s => %s',
                    $this->escape($key),
                    $this->escape($value)
                );
            }
        }

        return $insert_values;
    }
1257315
protected function dataToArray (array $data) {
        $result = [];
        foreach ($data as $key => $value) {
            if ($value instanceof ApiEntity) {
                $result[$key] = $value->toArray();
            } else if (is_array($value)) {
                $result[$key] = $this->dataToArray($value);
            } else {
                $result[$key] = $value;
            }
        }
        return $result;
    }
731130
protected function normalizeArray(array $data)
    {
        $ret = [];

        foreach ($data as $key => $value) {
            if (!\is_string($key)) {
                continue;
            }

            $ret[$key[0]] = [
                'value' => $value,
                'pattern' => $key,
            ];
        }

        return $ret;
    }
34629
public static function getRoutesDataFromData(array $data): array
    {
        assert(array_key_exists(self::KEY_ROUTES_DATA, $data));
        $result = $data[self::KEY_ROUTES_DATA];

        return $result;
    }
801091
protected function filterData($data): array
    {
        if (empty($this->getFields())) {
            return $data;
        }
        return array_intersect_key($data, array_flip($this->getFields()));
    }
313110
protected function arrayDotKeysFlattern(array $data)
    {
        foreach ($data as $name => $values) {
            if ($this->isIterable($values)) {
                foreach ($values as $key => $key_value) {
                    $data["$name.$key"] = $values[$key];
                }
                unset($data[$name]);
            }
        }
        return $data;
    }
118830
public function filter(array $data)
    {
        $filtered = [];

        foreach ($data as $row) {
            if ($this->passesFilter($row)) {
                $filtered[] = $row;
            }
        }

        return $filtered;
    }
1360250
protected function prepareRows(array $data)
    {
        $rows = [];

        foreach ($data as $date => $levels) {
            $rows[$date] = array_merge(compact('date'), $levels);
        }

        return $rows;
    }
845606
private static function separate(array $data)
    {
        $array = [];

        foreach ($data as $provider) {

            if(($bool = self::isDelim($provider)) === false) {
                $array['required'][] = $provider;
            }
            else {
                if ($bool[1] === 'true') {
                    $array['required'][] = strval($bool[0]);
                } else {
                    $array['hidden'][] = strval($bool[0]);
                }
            }
        }

        return $array;

    }
915882
public function createBinds(array $data): array
    {
        return array_map(function ($data) {
            if ($data instanceof Bind) {
                return $data;
            }

            return Bind::createFromData((array) $data);
        }, $data);
    }
499685
protected function getData($data):array{

		if(is_array($data)){
			return $data;
		}
		elseif($data instanceof Traversable){
			return iterator_to_array($data); // @codeCoverageIgnore
		}

		$msg = 'invalid data';
		$this->logger->error($msg);

		throw new InvalidArgumentException($msg);
	}
1059212
private function _merge(array $data) : array
    {
        $values = $this->getValues();
        $values = array_merge($values, $data);
        return $values;
    }
1094685
public function mapQueries(array $data): array
    {
        $queries = [];

        foreach ($data as $dataItem) {
            $queryId = (int) $dataItem['id'];
            $locale = $dataItem['locale'];

            if (!isset($queries[$queryId])) {
                $queries[$queryId] = [
                    'id' => $queryId,
                    'collectionId' => (int) $dataItem['collection_id'],
                    'type' => $dataItem['type'],
                    'status' => (int) $dataItem['status'],
                ];
            }

            $queries[$queryId]['parameters'][$locale] = $this->buildParameters((string) $dataItem['parameters']);
            $queries[$queryId]['availableLocales'][] = $locale;
        }

        $queries = array_values(
            array_map(
                static function (array $queryData): Query {
                    ksort($queryData['parameters']);
                    sort($queryData['availableLocales']);

                    return Query::fromArray($queryData);
                },
                $queries
            )
        );

        return $queries;
    }