Determines whether an item is present in the cache.

@param string $key The cache item key.

@throws \Psr\SimpleCache\InvalidArgumentException

@return bool
9117
public function has($key)
    {
        /* If $key is not valid string throws InvalidArgumentException */
        if (!$this->isString($key)) {
            throw new InvalidArgumentException('Cache key must be not empty string');
        }

        return $this->getCollection()->has($key);
    }
274487
function __isset($key) {
        if (!is_string($key)) {
            throw new \Calf\Exception\InvalidArgument('Key must be string.');
        }

        return isset($this->_keys[$key]);
    }
743996
public function containsKey($key)
    {
        if (!$this->enabled)
            return false;

        $has_key = false;

        $fetchMethod = $this->apcFuncPrefix.'_fetch';
        $fetchMethod($this->key($key), $has_key);

        // $this->Logger->debug("Cache contains {$key}? " . (($has_key) ? 'TRUE' : 'FALSE'));

        return $has_key;
    }
566246
protected function checkKey($key):string{

		if(!is_string($key) || empty($key)){
			$msg = 'invalid cache key: "'.$key.'"';
			$this->logger->error($msg);

			throw new InvalidArgumentException($msg);
		}

		return $key;
	}
1018717
public function isCached($key) {
    if (false != $this->_loadCache()) {
      $cachedData = $this->_loadCache();
      return isset($cachedData[$key]['data']);
    }
  }
69348
public function has($key)
    {
        return $this->enabled && $this->filesystem->exists($this->cacheDir.$key);
    }
1203424
public function isCached($key)
    {
        if ($cachedData = $this->loadCache()) {
            if (isset($cachedData[$key])) {
                if (!$this->isExpired($cachedData[$key]['time'], $cachedData[$key]['expire'])) {
                    return true;
                }
            }
        }
        return false; // If cache file doesn't exist or cache is empty or key doesn't exist in array, key isn't cached
    }
590745
public function exists($key)
    {
        if ($this->enabled) {
            return !$this->pool->getItem($key)->isMiss();
        } else {
            return false;
        }
    }
582406
protected function getCache($key)
    {
        if (array_key_exists($key, $this->cache)) {
            return $this->cache[$key];
        }
        return false;
    }
823573
function has( $key ) {
            $cache_entry = $this->_options->get_option( $key, false );

            return ( is_object( $cache_entry ) &&
                     isset( $cache_entry->timestamp ) &&
                     is_numeric( $cache_entry->timestamp )
            );
        }
58952
public function delete($key)
    {
        /* If $key is not valid string throws InvalidArgumentException */
        if (!$this->isString($key)) {
            throw new InvalidArgumentException('Cache key must be not empty string');
        }

        $path = sha1($key);

        if ($this->filesystem()->has($path)) {
            $this->filesystem()->delete($path);
            return true;
        }
        return false;
    }
1222616
public function containsKey($key): bool
    {
        return isset($this->items[$key]) || array_key_exists($key, $this->items);
    }
939168
public function __isset(string $key): bool
    {
        if (! \in_array($key, $this->definition['__isset'])) {
            throw new InvalidArgumentException("Unable to use __isset for [{$key}].");
        }

        return isset($this->{$key});
    }
1293869
public function has($key)
    {
        if (null === $key) {
            throw new Exception\InvalidArgumentException('The specified key name is null');
        }

        if (!is_scalar($key)) {
            throw new Exception\InvalidArgumentException('The specified key name must be a scalar');
        }

        return array_key_exists($key, $this->collections);
    }
1355053
public function has($key)
    {
        if (!$this->isEnabled()) {
            return false;
        }

        return (false !== $this->server->get($this->prefix . $key));
    }
949974
public function removeItem(string $key): bool
    {
        if (!$this->adapter instanceof iAdapter) {
            return false;
        }

        $storeKey = $this->calculateStoreKey($key);

        // remove static-cache
        if (
            !empty(self::$STATIC_CACHE)
            &&
            \array_key_exists($storeKey, self::$STATIC_CACHE)
        ) {
            unset(
                self::$STATIC_CACHE[$storeKey],
                self::$STATIC_CACHE_COUNTER[$storeKey],
                self::$STATIC_CACHE_EXPIRE[$storeKey]
            );
        }

        return $this->adapter->remove($storeKey);
    }
1086491
public function has($key)
    {
        $key = trim($key, '.');
        if (strpos($key, '.') !== false) {
            $array =& $this->_items;
            foreach (explode('.', $key) as $v) {
                if (!isset($array[$v]))
                    return false;
                else
                    $array =& $array[$v];
            }
            return true;
        } else {
            return array_key_exists($key, $this->_items);
        }
    }