Returns true if the array passed in parameter (generated with "toArray"), matches this package.

@param array $array
@return bool
179000
public function matchesPackage(array $array) {
		if (isset($array['package']) && $array['package'] == $this->package->getName()
				&& isset($array['file']) && $array['file'] == $this->getFile()) {
			return true;
		} else {
			return false;
		}
	}
494500
public static function has(array $array, string $path): bool
	{
		$segments = explode('.', $path);

		foreach($segments as $segment)
		{
			if(!is_array($array) || !array_key_exists($segment, $array))
			{
				return false;
			}

			$array = $array[$segment];
		}

		return true;
	}
1065925
public static function filterArray($array)
    {
        if (!is_array($array))
        {
            return false;
        }

        $clean = array();
        foreach ($array as $key => $string)
        {
            if (is_array($string))
            {
                self::filterArray($string);
            }
            else
            {
                $string = self::escape($string);
                $key = self::escape($key);
            }
            $clean[$key] = $string;
        }
        return $clean;
    }
981360
public static function has($array, $keys): bool
    {
        if (null === $keys) {
            return false;
        }

        $keys = (array)$keys;

        if (!$array) {
            return false;
        }

        if ($keys === []) {
            return false;
        }

        foreach ($keys as $key) {
            $subKeyArray = $array;

            if (static::exists($array, $key)) {
                continue;
            }

            foreach (explode('.', $key) as $segment) {
                if (static::accessible($subKeyArray) && static::exists($subKeyArray, $segment)) {
                    $subKeyArray = $subKeyArray[$segment];
                } else {

                    return false;
                }
            }
        }

        return true;
    }
461054
public static function isKeyWithElements($array, $key)
    {
        if (false === is_array($array) || false === isset($array[$key])) {
            return false;
        }

        if (false === is_array($array[$key])) {
            return false;
        }

        if (0 === count($array[$key])) {
            return false;
        }

        return true;
    }
191806
public static function is_numeric_array($array)
    {
        if (!is_array($array)) { return false; }

        $current = 0;
        foreach (array_keys($array) as $key) {
            if ($key !== $current) { return false; }

            $current++;
        }

        return true;
    }
241055
protected function filterResults(array $array)
    {
        $curWord = $this->context->getCurrentWord();

        return array_filter($array, function($val) use ($curWord) {
            return fnmatch($curWord.'*', $val);
        });
    }
1243092
public static function isSequential(array $array)
    {
        $count = count($array);

        for ($i = 0; $i < $count; $i++) {
            if (!isset($array[$i]) && !array_key_exists($i, $array)) {
                return false;
            }
        }

        return true;
    }
1252040
public static function isList(array $array): bool
	{
		$count = count($array);

		$range = $count
			? range(0, $count - 1)
			: [];

		$keys = array_keys($array);

		return $keys === $range;
	}
1267789
public static function kshuffle(&$array)
    {
        if (!is_array($array) || empty($array))
        {
            return false;
        }
        $tmp = [];
        foreach ($array as $key => $value)
        {
            $tmp[] = ['k' => $key, 'v' => $value];
        }
        shuffle($tmp);
        $array = [];
        foreach ($tmp as $entry)
        {
            $array[$entry['k']] = $entry['v'];
        }

        return true;
    }
905414
private function isAssocStr($array)
    {
        if(!is_array($array)){
            return false;
        }
        for (reset($array); is_int(key($array));
             next($array)) {
            if (is_null(key($array)))
                return false;
        }
        return true;
    }
1246567
public static function isAssociative($array)
	{
		if (\is_array($array))
		{
			foreach (array_keys($array) as $k => $v)
			{
				if ($k !== $v)
				{
					return true;
				}
			}
		}

		return false;
	}
646642
public static function isHash($array)
    {
        // is_array($data) && ( empty($data) || array_keys($data) === range(0, count($data)-1) );
        $hash = false;
        if (\is_array($array) && !empty($array)) {
            $keys = \array_keys($array);
            foreach ($keys as $k) {
                if (!\is_int($k)) {
                    $hash = true;
                    break;
                }
            }
        }
        return $hash;
    }
1346897
public static function isInstancesOf(array $array, string $className) : bool
    {
        if (!class_exists($className) && !interface_exists($className)) {
            return false;
        }

        $result = true;

        foreach ($array as $item) {
            $result = is_object($item) && $item instanceof $className && $result;
        }

        return $result;
    }
167941
protected static function array_flip_3d ($array) {
		if (!is_array($array)) {
			return false;
		}
		$result = [];
		$size   = 0;
		foreach ($array as $values) {
			$size = max($size, count((array)$values));
		}
		foreach ($array as $key => $values) {
			/** @noinspection ForeachInvariantsInspection */
			for ($i = 0; $i < $size; ++$i) {
				if (is_array($values)) {
					if (isset($values[$i])) {
						$result[$i][$key] = $values[$i];
					}
				} else {
					$result[$i][$key] = $values;
				}
			}
		}
		return $result;
	}
1221095
public static function key_exists($array, $key)
	{
		foreach (explode('.', $key) as $key_part)
		{
			if ( ! is_array($array) or ! array_key_exists($key_part, $array))
			{
				return false;
			}

			$array = $array[$key_part];
		}

		return true;
	}
174317
public static function validateMeta(array &$array)
    {

        foreach ($array as $key => $tag) {
            if (!($tag instanceof Meta)) {
                $newtag = new Meta($tag);
                $array[$key] = $newtag;
            }
        }
    }