Assert required API keys exist and are valid.

@param array $keys Array of required and optional
authentication and argument keys (string) for API method.
432936
private function assertKeysArrayValid($keys = null)
    {
        if ((!$keys) ||
            (!is_array($keys)) ||
            (!isset($keys['auth'])) || 
            (!is_array($keys['auth'])) ||
            (!isset($keys['auth']['req'])) || 
            (!is_array($keys['auth']['req'])) ||
            (!isset($keys['auth']['opt'])) || 
            (!is_array($keys['auth']['opt'])) ||
            (!isset($keys['args'])) || 
            (!is_array($keys['args'])) ||
            (!isset($keys['args']['req'])) || 
            (!is_array($keys['auth']['req'])) ||
            (!isset($keys['args']['opt'])) || 
            (!is_array($keys['auth']['opt']))
        ) {
            $msg = 'Invalid API keys provided. (HINT: Each '
                 . 'API class must define a $keys array with '
                 . 'specific key requirements. (HINT: View an /Api/[file] '
                 . 'for an example.)';
            throw new ApiException($msg);
        }
    }
1302359
public function wasModified($keys=null)
    {
        $this->bootOnce();

        $modified = $this->getModifiedData();
        $unsettedKeys = $this->getUnsettedKeys();

        if (!$keys) {
            return (bool)$modified || (bool)$unsettedKeys;
        }

        $keys = is_array($keys) ? $keys : func_get_args();

        foreach ($keys as $key) {

            if (array_key_exists($key, $modified)) {
                return true;
            }

            if (in_array($key, $unsettedKeys)) {
                return true;
            }
        }

        return false;

    }
41929
protected function hasArrayKey(array $array, array $keys): bool
    {
        foreach ($keys as $key) {
            if (array_key_exists($key, $array)) {
                return true;
            }
        }

        return false;
    }
942779
public static function keysExist ($array, $keys)
		{
			if (!is_array($array))
				return null;

			if (!is_array($keys))
				$keys = [ $keys ];

			foreach ($keys as $key)
				if (!array_key_exists($key, $array))
					return false;

			return true;
		}
1216914
public static function isAnyKeyNull(array $keys = []): bool
    {
        foreach ($keys as $key) {
            if ($key === null) {
                return true;
            }
        }

        return false;
    }
1250069
public static function assertHas(
        array $params,
        string $key,
        $context = null
    ) {
        if (self::has($params, $key)) {
            return;
        }

        $message = self::buildErrorMessage(
            $params,
            $key,
            "Property ({$key}) is missing and is required",
            $context
        );

        self::throwParamException(
            $params,
            $key,
            new ArrayPropertyMissing($message)
        );
    }
1119994
protected function validateKey($key)
    {
        if (!in_array($key, self::$validKeys)) {
            throw new InvalidArgumentException('Unsupported key "%s" passed to LinkedIn data storage. Valid keys are: %s', $key, implode(', ', self::$validKeys));
        }
    }
594256
private function arrayHasKeys(array $input, array $keys)
    {
        foreach ($keys as $key) {
            if (!array_key_exists($key, $input)) {
                throw new \InvalidArgumentException(sprintf(
                    'Input missing required one or more required keys. Required keys are %s',
                    implode(', ', $keys)
                ));
            }
        }
    }
765563
public function assertSessionMissing($key)
    {
        if (is_array($key)) {
            foreach ($key as $k) {
                $this->assertSessionMissing($k);
            }
        } else {
            PHPUnit::assertFalse($this->app['session.store']->has($key), "Session has unexpected key: $key");
        }
    }
1368227
public function hasAny($keys)
    {
        $keys = is_array($keys) ? $keys : func_get_args();

        $input = $this->all();

        foreach ($keys as $key) {
            if (Arr::has($input, $key)) {
                return true;
            }
        }

        return false;
    }
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;
	}
900802
private function isKeyRange($key, Array $keys)
    {
        if (empty($keys)) {
            return false;
            
        }
        return \reset($keys)->getKey() <= $key
            && \end($keys)->getKey() >= $key;
    }
515020
public static function hasKey(Array $array, Array $keys)
    {
        foreach ($array as $key => $value) {
            if (in_array($key, $keys)) {
                return true;
            }
        }

        return false;
    }
715256
public function hasAny($keys = [])
    {
        if ($this->isEmpty()) {
            return false;
        }

        $keys = is_array($keys) ? $keys : func_get_args();

        foreach ($keys as $key) {
            if ($this->has($key)) {
                return true;
            }
        }

        return false;
    }
1317665
private function validateInput($haystack, $keys)
    {
        if (!is_array($haystack) || empty($haystack)) {
            throw new \InvalidArgumentException(
                "Provided input array is either empty or not an array."
            );
        }
        if (!is_array($keys) || empty($keys)) {
            throw new \InvalidArgumentException(
                "Provided input keys argument is either empty or not an array."
            );
        }
    }
669705
public function setRequired($keys)
    {
        if(is_string($keys))
        {
            $this->setRequired(explode(",",$keys));
        }
        else
        {
            foreach($keys as $key)
            {
                if(!in_array($key, $this->required))
                    $this->required[] = $key;
            }
        }

        return $this;
    }
805481
public static function set(array &$array, ...$keys): void
    {
        if (\count($keys) < 2) {
            throw new \InvalidArgumentException('Method `Collection::set()` is required minimum one key and value');
        }

        $value = array_pop($keys);
        while (\count($keys) > 1) {
            $key = array_shift($keys);
            if (!isset($array[$key]) || !\is_array($array[$key])) {
                $array[$key] = [];
            }
            $array = &$array[$key];
        }
        $array[array_shift($keys)] = $value;
    }