@param array       $array
@param string|null $type

@return array
355691
public static function decodeArray(array $array, string $type = null): array
    {
        foreach ($array as &$v) {
            $v = self::run(self::DECODER, $v, $type);
        }

        return $array;
    }
777098
public function fromArray( $array ){
		foreach( $array as $key => $value ){
			if( is_array( $value ) ){
				$this->__set( $key, NULL );
				$this->data[$key]->fromArray( $value );
			}
			else{
				$this->__set( $key, $value );
			}
		}

	}
1150582
public function getUnits($type = null)
    {
        if (!isset($type)) {
            return $this->units;
        }

        $filtered = array();
        foreach ($this->units as $key => $value) {
            if (isset($value['type']) && $value['type'] === $type) {
                $filtered[$key] = $value;
            }
        }

        return $filtered;
    }
591517
public function getTags(int $type = null): array
    {
        if ($type === null) {
            return $this->tags;
        }

        return array_filter($this->tags, function (Tag $tag) use ($type): bool {
            return $tag->getType() === $type;
        });
    }
1201879
public static function assoc($arr, $name, $type = null)
    {
        $ret = [];
        if (empty($arr)) {
            return $ret;
        }
        if ($type == self::GETTER) {
            $method = 'get' . $name;
            foreach ($arr as $elem) {
                $ret[$elem->$method()] = $elem;
            }
        } elseif ($type == self::OBJ) {
            foreach ($arr as $elem) {
                $ret[$elem->$name] = $elem;
            }
        } else {
            foreach ($arr as $elem) {
                $ret[$elem[$name]] = $elem;
            }
        }
        return $ret;
    }
735447
protected function addArray($type, array $array)
    {
        if (!isset($array['loc'])) {
            return false;
        }
        $array['loc'] = $this->urlEncode(trim($array['loc']));
        if ($this->urlValidate($array['loc'])) {
            switch ($type) {
                case self::XML_TAG_SITEMAP:
                    $this->sitemaps[$array['loc']] = $this->fixMissingTags(['lastmod'], $array);
                    return true;
                case self::XML_TAG_URL:
                    $this->urls[$array['loc']] = $this->fixMissingTags(['lastmod', 'changefreq', 'priority'], $array);
                    return true;
            }
        }
        return false;
    }
241024
public function clear($type = null)
    {
        if (false === $this->mf->hasCache()) {
            return [];
        }
        return $this->doClear($this->getTypes($type));
    }
775153
protected function getValue($key, array $array = array())
    {
        $keys = $this->parseKey($key);

        while (count($keys) > 0 and !is_null($array)) {
            $key = array_shift($keys);
            $array = isset($array[$key]) ? $array[$key] : null;
        }

        return $array;
    }
1056777
public static function get($array, string $key, $default = null)
    {
        if (! Assert::array($array)) {
            return $default;
        }

        $key = trim($key);

        if ($key === '') {
            return $array;
        }

        if (static::exists($array, $key)) {
            return $array[$key];
        }

        foreach (explode('.', $key) as $segment) {
            if (Assert::array($array) && static::exists($array, $segment)) {
                $array = $array[$segment];
            } else {
                return $default;
            }
        }

        return $array;
    }
377895
public static function array_filter_values($array, $c = null)
    {
        if (isset($c['with'])) {

            $data = array();

            foreach ($array as $key => $value) {
                if (strpos($value, $c['with'])) {
                    $data[$key] = $value;
                }
            }

            return $data;
        } else {
            return array_filter($array);
        }
    }
582686
public static function arrayGet(array $array, $key, $default = null)
    {
        if (isset($array[$key])) {
            return $array[$key];
        }

        foreach (explode('.', $key) as $segment) {
            if (!is_array($array) || !array_key_exists($segment, $array)) {
                return $default;
            }

            $array = $array[$segment];
        }

        return $array;
    }
1306494
public function lists($type = null)
    {
        $params = [
            'type' => $type,
        ];

        return $this->parseJSON('get', [self::API_LISTS, $params]);
    }
62999
public function intersection($array=null) {
    $arrays = self::_wrapArgs(func_get_args(), 1);
    
    if(count($arrays) === 1) return self::_wrap($array);
    
    $__ = new self;
    $return = $__->first($arrays);
    foreach($__->rest($arrays) as $next) {
      if(!$__->isArray($next)) $next = str_split((string) $next);
      
      $return = array_intersect($return, $next);
    }
    
    return self::_wrap(array_values($return));
  }
1262612
public static function valuesWithType(array $inputArray, string $type): array
    {
        $newArray = [];
        foreach ($inputArray as $key => $value) {
            if (is_scalar($value)) {
                $newValue = $value;
                settype($newValue, $type);
                $newArray[$key] = $newValue;
            }
        }

        return $newArray;
    }
480879
private function phpize(array $array, string $key, string $type)
    {
        if (!isset($array[$key])) {
            return null;
        }

        switch ($type) {
            case 'bool':
                if (\is_bool($array[$key])) {
                    return $array[$key];
                }
                break;
            case 'string':
                if (\is_string($array[$key])) {
                    return $array[$key];
                }
                break;
        }

        throw new InvalidArgumentException(sprintf('The property "%s" must be a "%s", "%s" given.', $key, $type, \gettype($array[$key])));
    }
116100
public static function get(array $array, string $key = null, $default = null)
    {
        if ($key === null) {
            return $array;
        }

        if ($array === []) {
            return $default;
        }

        if (isset($array[$key])) {
            return $array[$key];
        }

        foreach (\explode('.', $key) as $segment) {
            if (\is_array($array) && isset($array[$segment])) {
                $array = $array[$segment];
            } else {
                return $default;
            }
        }

        return $array;
    }
838832
public function loadFromArray(array $array)
    {
        if (isset($array['filename'])) {
            $this->filename = $array['filename'];
        }

        if (isset($array['size'])) {
            $this->size = $array['size'];
        }

        if (isset($array['type'])) {
            $this->type = $array['type'];
        }

        if (isset($array['cid'])) {
            $this->cid = $array['cid'];
        }

        if (isset($array['href'])) {
            $this->href = $array['href'];
        }

        return $this;
    }