Determines if the signed request is valid.

@param string $key
The key to validate the signature with.

@return bool
true if the signature matches the computed signature, false
otherwise.
544432
public function isValid(string $key) : bool
    {
        if (!$this->headers->has($this->algorithmHeader)) {
            return false;
        }

        if (!$this->headers->has($this->signatureHeader)) {
            return false;
        }

        $signature = new Signature(new Payload($this->request), $this->getAlgorithm(), $key);

        return $signature->equals($this->getSignature());
    }
1010373
public function offsetExists($key): bool
    {
        assert(
            is_string($key),
            sprintf('Invalid metadata key: (%s) %s', gettype($key), VarPrinter::toString($key))
        );

        return $this->has($key);
    }
1363305
public function hasValidSignature(Request $request)
    {
        $url = $request->url();

        $original = rtrim($url.'?'.Arr::query(
            Arr::except($request->query(), 'signature')
        ), '?');

        $expires = $request->query()['expires'] ?? null;

        $signature = \hash_hmac('sha256', $original, \call_user_func($this->keyResolver));

        return  \hash_equals($signature, (string) $request->query('signature', '')) &&
               ! ($expires && Carbon::now()->getTimestamp() > $expires);
    }
597948
public static function has(string $key) : bool
  {
    if ((new Cache)->retrieve($key) == null) return false;
    return true;
  }
194418
public function exists($key)
    {
        // Checks if we need to verify a nested array
        if (preg_match('/\.+/', $key))
        {
            $keys   = explode('.', $key);
            $levels = count($keys);

            // Quick workaround
            if ($levels == 4)
            {
                return isset($this->params[$keys[0]][$keys[1]][$keys[2]][$keys3]);
            }
            else if ($levels == 3)
            {
                return isset($this->params[$keys[0]][$keys[1]][$keys[2]]);
            }
            else
            {
                return isset($this->params[$keys[0]][$keys[1]]);
            }
        }

        // Non-nested array validation
        if (array_key_exists($key, $this->params))
        {
            return true;
        }

        return false;
    }
1106990
public function has($key)
    {
        /*
         * Version >= 4.0 of phpredis returns an integer instead of bool
         */
        $check = $this->redis->exists($this->decorateKey($key));

        if (is_bool($check)) {
            return $check;
        }

        return $check > 0;
    }
972886
public function ifExists(string $key): bool
    {
        if ($this->get($key) === false) {
            return false;
        }

        return true;
    }
636374
public function has($key)
    {
        return (isset($this->headers[$this->normalizeKey($key)])) ? true : false;
    }
619331
private function validateCacheKey($key)
    {
        // TODO: Remove when PHP 5 support dropped and replace with string hint.
        if (!is_string($key)) {
            throw new InvalidCacheKeyException('Cache key must be a string.');
        }

        if (strpbrk($key, CacheKeyGenerator::RESERVED_CHARACTERS) !== false) {
            throw new InvalidCacheKeyException(sprintf(
                'Cache key "%s" contains one or more reserved characters: "%s".',
                $key,
                CacheKeyGenerator::RESERVED_CHARACTERS
            ));
        }
    }
365634
public function validateId($key): bool
    {
        if (\preg_match('/^[a-zA-Z0-9-]{127}+$/', $key) !== 1) {
            return false;
        }

        $filename = $this->savePath . \DIRECTORY_SEPARATOR . $this->prefix . $key;

        return \file_exists($filename);
    }
433328
public function has(string $key): bool
    {
        $key = $this->prepareKey($key);
        return Arr::has($this->properties, $key);
    }
41624
public static function isValidKey($key) {
        if(!is_string($key)) {
            throw EnumerationException::invalidKeyType(gettype($key));
        }

        return array_key_exists($key, self::toArray());
    }
1249582
public function is($key) {
        $code = $this->current()->getCode();

        return ($code === $key || $this->canonicalize($code) === $key);
    }
700344
public function __isset($key)
    {
        switch (true) {
            case isset($this->_params[$key]):
                return true;
            case isset($_GET[$key]):
                return true;
            case isset($_POST[$key]):
                return true;
            case isset($_COOKIE[$key]):
                return true;
            case isset($_SERVER[$key]):
                return true;
            case isset($_ENV[$key]):
                return true;
            default:
                return false;
        }
    }
640656
public function has(string $key): bool
    {
        return !empty(Helper::arrayGet($this->data, $key));
    }
346821
public static function has(string $key) : bool
  {
    $expect = explode('.', $key);
    $config = Config::all();

    foreach($expect as $setting) {
      if (!isset($config[$setting])) return false;
      $config = $config[$setting];
    }

    return true;
  }
734796
public function has($key)
    {
        if (!is_string($key)) {
            throw new \InvalidArgumentException(htmlspecialchars(
                "Get function only accepts strings. Input was: $key."
            ));
        }

        return isset($this->services[ $key ]) || isset($this->instances[ $key ]);
    }