Checks to see if an array of links exist within the current navigation array
@param array $array an array containing the links
@return boolean If all of the links exist within the current navigation array return true else returns false
967293
public function hasLinks($array) {
        if(is_array($array)) {
            foreach($array as $link) {
                if($this->hasLink($link) === false) {
                    return false;
                }
            }
            return true;
        }
        return false;
    }
789321
public static function has( $array, $key )
	{
		if ( !$array )
			return false;

		if ( is_null( $key ) )
			return false;

		if ( static::exists( $array, $key ) )
			return true;

		foreach ( explode( '.', $key ) as $segment )
			if ( static::accessible( $array ) && static::exists( $array, $segment ) )
				$array = $array[$segment];
			else
				return false;

		return true;
	}
1367712
private function validateArray(array $array): bool
  {
    foreach ($array as $element)
    {
      if (is_array($element))
      {
        $tmp = $this->validateArray($element);
        if ($tmp===true)
        {
          return true;
        }
      }
      else
      {
        if ($element!==null && $element!==false && $element!=='')
        {
          return true;
        }
      }
    }

    return false;
  }
1161
public function checkAuthArray($array)
	{

		//root
		if(array_has($array, 'root')){
			if(array_get($array, 'root') != 'only') {
				die('FooWeChat\Authorize\Auth\checkAuthArray: 参数 root 值错误');
			}
		}

		//admin
		if(array_has($array, 'admin')){
			$a = array_get($array, 'admin');
			if($a != 'yes' && $a != 'no' && $a != 'only') {
				die('FooWeChat\Authorize\Auth\checkAuthArray: 参数 admin 值错误');
			}
		}

		//way
		if(array_has($array, 'way')){
			$a = array_get($array, 'way');
			if($a != 'wechat' && $a != 'web' && $a != 'all') {
				die('FooWeChat\Authorize\Auth\checkAuthArray: 参数 way 值错误');
			}
		}

		//except
		if(array_has($array, 'except')){
			$this->checkUser(array_get($array, 'except'));
		}

		//user
		if(array_has($array, 'user')){
			$this->checkUser(array_get($array, 'user'));
		}

	}
309218
protected function exists(array $array, $key)
    {
        if (isset($array[$key])) {
            return true;
        }

        foreach (explode(".", $key) as $part) {
            if (!is_array($array) or !isset($array[$part])) {
                return false;
            }

            $array = $array[$part];
        }

        return true;
    }
1104252
public static function has($array, $keys)
	{
		if(is_null($keys) || !$array)
			return false;

		$keys = static::toArray($keys);

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

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

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

			foreach (static::toKey($key) as $segment) {
				if (static::accessible($subKeyArray) && static::exists($subKeyArray, $segment))
					$subKeyArray = $subKeyArray[$segment];
				else
					return false;
			}
		}

		return true;
	}
260252
private function sortJson(array &$array)
    {
        // check if array is not a hash table, because we only want to sort hash tables
        if (
            [] === $array
            || !(array_keys($array) !== range(0, count($array) - 1))
        ) {
            return false;
        }

        ksort($array);
        foreach ($array as &$item) {
            if (is_array($item)) {
                $this->sortJson($item);
            }
        }
    }
403920
private static function recursiveWalk($array) {
		foreach ($array as $k => $v) {
        if (is_array($v)) {
            $array[$k] = self::recursiveWalk($v);
        } else {
            $array[$k] = self::compareReplaceListVars($v);
        }
    }
		return $array;
	}
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;
	}
1163195
protected static function array_key_exists( $key, $array, $useIsset = false )
    {
        if ( !is_array( $key ) )
        {
            $key = array($key);
        }

        foreach ( $key as $_key )
        {
            if ( ( $useIsset && isset( $array[$_key] ) ) || array_key_exists( $_key, $array ) )
            {
                return $_key;
            }
        }

        return false;
    }
400871
protected function isPaginated(array $json)
    {
        if (!array_key_exists('links', $json) || !array_key_exists('meta', $json)) {
            return false;
        }
        if (is_array($json['links'])
            && array_key_exists('self', $json['links'])
            && array_key_exists('first', $json['links'])
            && array_key_exists('last', $json['links'])
            && isset($json['meta']['pagination'])
            && is_array($json['meta']['pagination'])
            && array_key_exists('total', $json['meta']['pagination'])
            && array_key_exists('count', $json['meta']['pagination'])
            && array_key_exists('per_page', $json['meta']['pagination'])
            && array_key_exists('current_page', $json['meta']['pagination'])
            && array_key_exists('total_pages', $json['meta']['pagination'])
        ) {
            return true;
        }
        return false;
    }
1133027
protected static function isArrayMultiline($array)
    {
        if (empty($array)) return false;

        switch (self::getArrayMode()) {
            case self::ARR_MODE_SINGLELINE:
                $isMultiline = false;
                break;
            case self::ARR_MODE_MULTILINE:
                $isMultiline = true;
                break;
            default: // for ARR_MODE_AUTO
                $isMultiline = Arr::isAssoc($array) ? true : false;
                return $isMultiline;
        }
        return $isMultiline;
    }
942172
public static function isIndexedArray($array)
    {
        if (! is_array($array)) {
            return false;
        }

        foreach ($array as $key => $value) {
            if (! is_numeric($key)) {
                return false;
            }
        }

        return true;
    }
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;
		}
	}
741024
private function matchVersion(array $array)
    {
        if (!isset($array["version"])) {
            return true;
        }

        if (is_array($array["version"])) {
            foreach ($array["version"] as $version)
            {
                if ($version == $this->getVersion() || $version == "*") {
                    return true;
                }
            }
        } elseif (is_string($array["version"])) {
            if ($array["version"] == $this->getVersion() || $array["version"] == "*") {
                return true;
            }
        }

        return false;
    }
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;
    }
1246567
public static function isAssociative($array)
	{
		if (\is_array($array))
		{
			foreach (array_keys($array) as $k => $v)
			{
				if ($k !== $v)
				{
					return true;
				}
			}
		}

		return false;
	}