From filter array.

@param array $array

@return LocationRange
9682
public static function fromFilterArray(array $array): LocationRange
    {
        $coordinates = array_map(function (array $coordinate) {
            return Coordinate::createFromArray($coordinate);
        }, $array['coordinates']);

        return new Polygon($coordinates);
    }
25978
public static function fromArray($array)
    {
        if (!is_array($array)) {
            throw new InvalidArgumentException("Expected array, got " . gettype($array));
        }

        $model = new static();

        foreach ($array as $key => $value) {
            if (property_exists($model, $key)) {
                $model->$key = $value;
            }
        }

        return $model;
    }
1117818
public function copyToArray(array &$array)
    {
        $array['formatted']      = $this->formatted;
        $array['street_address'] = $this->streetAddress;
        $array['locality']       = $this->locality;
        $array['region']         = $this->region;
        $array['postal_code']    = $this->postalCode;
        $array['country']        = $this->country;
    }
673869
public static function createFromArray(array $array): self
    {
        if (empty($array['name'])) {
            throw InvalidFormatException::queryFormatNotValid($array);
        }

        return self::create(
            $array['name'],
            $array['field'] ?? 'uuid.type',
            (int) ($array['application_type'] ?? Filter::AT_LEAST_ONE),
            $array['filter_type'] ?? Filter::TYPE_FIELD,
            $array['subgroup'] ?? [],
            $array['sort'] ?? self::SORT_BY_COUNT_DESC,
            $array['limit'] ?? self::NO_LIMIT
        );
    }
107198
public static function fromArray($array, $builder)
    {
        $children = [];
        foreach ($array['children'] as $child) {
            $children[] = FilterBuilder::getBuilderFromArray($child, $builder);
        }

        return (new static($children))->setBuilder($builder);
    }
430382
public function without($array)
    {
        $values = func_get_args();
        unset($values[0]);

        if ($values) {
            foreach ($values as $value) {
                unset($array[array_search($value, $array)]);
            }
        }

        return $array;
    }
157566
public static function flatten(array $array)
    {
        $out = [];

        foreach (new RecursiveIteratorIterator(new RecursiveArrayIterator($array)) as $key => $item) {
            if (is_int($key)) {
                $out[] = $item;
            } else {
                $out[$key] = $item;
            }
        }

        return $out;
    }
1201281
public static function fromArray($array)
    {
        $values   = $array['value'];
        $property = $array['property'];

        if (!(isset($values, $property))) {
            throw new DcGeneralInvalidArgumentException('Invalid filter array provided  ' . \var_export($array, true));
        }

        return new static($property, $values);
    }
935615
private function removeUnrealizableInArray(array &$array)
    {
        $this->removeReferenceItemInArray($array);
        foreach ($array as &$value) {
            if (is_object($value)) {
                $value = $this->removeUnserializable($value);
            }
            if (is_array($value)) {
                $this->removeUnrealizableInArray($value);
            }
            if ($this->isUnserializable($value)) {
                $value = null;
            }
        }

        return $array;
    }
5134
public function filter(&$array) {
        while(list($key, $var) = each($array)) {
            if ($key != 'argc' && $key != 'argv' && (strtoupper($key) != $key || '' . intval($key) == "$key")) {
                if (is_string($var)) {
                    $array[$key] = stripslashes($var);
                }
                if (is_array($var))  {
                    $array[$key] = $this->filter($var);
                }
            }
        }
        return $array;
    }
1095869
public function hydrateFromArray(array $array)
    {
        $this->clear();

        //If this is a 0-indexed numerical key array, add 1 to all the keys so
        //it is a 1-indexed numerical key array
        if (current(array_keys($array)) === 0) {
            $array = array_combine(
                range(1, count($array)),
                array_values($array)
            );
        }

        foreach ($array as $key => $value) {
            $this->push(
                $this->wye->makeBinding($key, $value)
            );
        }

        return $this;
    }
1047296
public static function createFromArray(array $array): self
    {
        $result = self::create(
            $array['query_uuid'] ?? '',
            $array['total_items'] ?? 0,
            $array['total_hits'] ?? 0,
            isset($array['aggregations'])
                ? Aggregations::createFromArray($array['aggregations'])
                : null,
            $array['suggests'] ?? [],
            array_map(function (array $item) {
                return Item::createFromArray($item);
            }, $array['items'] ?? [])
        );

        $result->subresults = array_filter(
            array_map(function (array $subresultAsArray) {
                return Result::createFromArray($subresultAsArray);
            }, $array['subresults'] ?? [])
        );

        return $result;
    }
1248322
protected function createModelFromArray(array $array)
    {
        $account = new SEPAAccount();
        $account->setIban($array[1]);
        $account->setBic($array[2]);
        $account->setAccountNumber($array[3]);
        $account->setSubAccount($array[4]);
        $account->setBlz($array[6]);

        return $account;
    }
1055647
private function trimArray(&$array)
    {
        foreach ($array as $key => $value) {
            if (is_string($value)) {
                $array[$key] = trim($value);
            } else if (is_array($value)) {
                $array[$key] = $this->trimArray($value);
            }
        }

        return $array;
    }
328898
public static function createFromArray(array $array): self
    {
        $map = new self;

        foreach ($array as $key => $value) {
            $map->put($key, $value);
        }

        return $map;
    }
656206
protected function fromArray(array $array)
    {
        if (is_array($array)) {
            foreach ($array as $index => $element) {
                if (is_array($element)) {
                    $this->xmlWriter->startElement($index);
                    $this->fromArray($element);
                    $this->xmlWriter->endElement();
                } else {
                    $this->xmlWriter->startElement($index);
                    $this->xmlWriter->text($element);
                    $this->xmlWriter->endElement();
                }
            }
        }
    }
183436
public static function createFromArray(array $array)
    {
        $scoreStrategy = new self();
        $scoreStrategy->type = $array['type'] ?: self::DEFAULT_TYPE;
        $scoreStrategy->configuration = $array['configuration'] ?? [];
        $scoreStrategy->weight = $array['weight'] ?? self::DEFAULT_WEIGHT;
        $scoreStrategy->scoreMode = $array['score_mode'] ?? self::SCORE_MODE_AVG;
        $scoreStrategy->filter = is_array($array['filter'])
            ? Filter::createFromArray($array['filter'])
            : null;

        return $scoreStrategy;
    }