extract pager options from array
@param  array $data
@return array
481040
static public function extractPagerOptions($data)
    {
        $options = [];
        if (is_array($data)) foreach ($data as $k=>$v) {
            if (in_array($k, ['show_style', 'show_pages', 'prev_title', 'next_title'])) {
                $options[$k] = $v;
            }
        }
        return $options;
    }
261923
private function asData(array $data)
    {
        foreach ($data as $key => $value) {
            if ($value instanceof RawSqlFragmentInterface) {
                $data[$key] = $value->getFragment();
            } elseif ($value instanceof RawBindingInterface) {
                $data[$key] = $value->getTarget();
            } else {
                $placeholder = $this->getUniqPlaceholder();

                $data[$key] = $placeholder;
                $this->bind($placeholder, $value);
            }
        }

        return $data;
    }
392169
protected function cleanData(array $data): array
    {
        $options = $this->getOptions();

        $disallowedDataKeys = array(
            $options->getIdColumnName(),
            $options->getLeftColumnName(),
            $options->getRightColumnName(),
            $options->getLevelColumnName(),
            $options->getParentIdColumnName(),
        );

        if (null !== $options->getScopeColumnName()) {
            $disallowedDataKeys[] = $options->getScopeColumnName();
        }

        return array_diff_key($data, array_flip($disallowedDataKeys));
    }
49713
protected function makePagerFromArray($data, $page = 1, $limit = 10)
    {
        $adapter = new ArrayAdapter($data);
        $pager   = new Pagerfanta($adapter);
        $pager->setMaxPerPage($limit);
        $pager->setCurrentPage($page);

        return $pager;
    }
605309
private function normalizeData($data)
    {
        $normalizedData = [];

        foreach ($data as $key => $value) {
            if ('#text' === $key) {
                $key = 'direction';
            }

            $normalizedData[trim($key, '_')] = $value;
        }

        return $normalizedData;
    }
736534
protected function extractPrices(array $data)
    {
        $calculator = new Calculator();

        $calculator->loadTaxRuleWithoutProduct(
            TaxRuleQuery::create()->findPk($data["tax_rule_id"]),
            Country::getShopLocation()
        );

        $price = null === $data["price_with_tax"] ?
            $data["price"] :
            $calculator->getUntaxedPrice($data["price_with_tax"])
        ;

        $salePrice = null === $data["sale_price_with_tax"] ?
            $data["sale_price"] :
            $calculator->getUntaxedPrice($data["sale_price_with_tax"])
        ;

        return [$price, $salePrice];
    }
1050800
protected function getAcfFromPage(int $pageId): array
    {
        $data = [];
        try {
            $data = $this->wpProvider->getFields($pageId);
        } catch (\Throwable $e) {
            ;
        }

        if (!is_array($data) || empty($data)) return [];

        return $data;
    }
2395
private function prepareRequestParams(array $data)
    {
        $has_resource = false;
        $multipart = [];

        foreach ($data as $key => $value) {
            if (!is_array($value)) {
                $multipart[] = ['name' => $key, 'contents' => $value];
                continue;
            }

            foreach ($value as $multiKey => $multiValue) {
                is_resource($multiValue) && $has_resource = true;
                $multiName = $key . '[' . $multiKey . ']' . (is_array($multiValue) ? '[' . key($multiValue) . ']' : '') . '';
                $multipart[] = ['name' => $multiName, 'contents' => (is_array($multiValue) ? reset($multiValue) : $multiValue)];
            }
        }

        if ($has_resource) {
            return ['multipart' => $multipart];
        }

        return ['form_params' => $data];
    }
23771
private function extractScriptDataValue_ECMAArray(&$data)
    {
        $result = [];
        if (isset($data[4])) {
            $approximateLength = $this->parseUI32(substr($data, 0, 4));
            $data = substr($data, 4);
            while ($data !== '') {
                $propertyName = $this->extractScriptDataValue_String($data);
                $propertyValue = $this->extractScriptDataValue($data);
                if ($propertyName === '' && $propertyValue === null) {
                    // Object end marker
                    break;
                }
                $result[$propertyName] = $propertyValue;
            }
        }

        return $result;
    }
310102
public function toArray(array $data = [])
    {
        return array_filter(array_merge([
            'start' => $this->start,
            'range' => $this->range,
            'sort' => $this->sort,
            'sortDir' => $this->sortDirection,
            'search' => $this->search,
            'searchNotes' => $this->searchNotes,
            'condition' => $this->condition ? json_encode($this->condition) : null
        ], $data), function ($value) {
            return $value !== null;
        });
    }
330609
public static function getRouterParametersFromData(array $data): array
    {
        assert(array_key_exists(self::KEY_ROUTER_PARAMS, $data));
        $result = $data[self::KEY_ROUTER_PARAMS];
        assert(empty($result) === false);

        return $result;
    }
505624
public function enrichWithMetaInformation(array $data)
    {
        $data['ip']        = (true === isset($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : null;
        $data['useragent'] = (true === isset($_SERVER['HTTP_USER_AGENT'])) ? $_SERVER['HTTP_USER_AGENT'] : null;
        $data['timestamp'] = time();

        return $data;
    }
516589
public static function arrayResolve(array $data)
    {

        $array = [];

        foreach ($data as $provider => $bool) {

            if ($bool === true) {

                $array['required'][] = $provider;

            }
            else {

                $array['hidden'][] = $provider;

            }
        }

        return $array;
    }
310584
protected function filterFields(array $data): array
    {
        $fields = $this->getFilterFields();

        if ($fields === null) {
            return $data;
        }

        return array_intersect_key(
            $data,
            array_flip(
                iterator_to_array($fields)
            )
        );
    }
104273
protected function pullOutNestedIncludedData(array $data)
    {
        $includedData = [];
        $linkedIds = [];

        foreach ($data as $value) {
            foreach ($value as $includeObject) {
                if (isset($includeObject['included'])) {
                    list($includedData, $linkedIds) = $this->serializeIncludedObjectsWithCacheKey($includeObject['included'], $linkedIds, $includedData);
                }
            }
        }

        return [$includedData, $linkedIds];
    }
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;
    }
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;
    }