public function exists(string $key): bool
    {
        $driver = $this->getDriver();
        $exists = $driver->get($key) !== null;
        if ($this->hasEventListeners('itemExists')) {
            $this->dispatchEvent('itemExists', new \BearFramework\App\Cache\ItemExistsEventDetails($key, $exists));
        }
        if ($this->hasEventListeners('itemRequest')) {
            $this->dispatchEvent('itemRequest', new \BearFramework\App\Cache\ItemRequestEventDetails($key));
        }
        return $exists;
    }
public function exists(string $key): bool
    {
        $driver = $this->getDriver();
        $exists = $driver->get($key) !== null;
        if ($this->hasEventListeners('itemExists')) {
            $this->dispatchEvent('itemExists', new \BearFramework\App\Cache\ItemExistsEventDetails($key, $exists));
        }
        if ($this->hasEventListeners('itemRequest')) {
            $this->dispatchEvent('itemRequest', new \BearFramework\App\Cache\ItemRequestEventDetails($key));
        }
        return $exists;
    }
public function exists ( string $ key ) : bool { $ driver = $ this -> getDriver ( ) ; $ exists = $ driver -> get ( $ key ) !== null ; if ( $ this -> hasEventListeners ( 'itemExists' ) ) { $ this -> dispatchEvent ( 'itemExists' , new \ BearFramework \ App \ Cache \ ItemExistsEventDetails ( $ key , $ exists ) ) ; } if ( $ this -> hasEventListeners ( 'itemRequest' ) ) { $ this -> dispatchEvent ( 'itemRequest' , new \ BearFramework \ App \ Cache \ ItemRequestEventDetails ( $ key ) ) ; } return $ exists ; }
Returns information whether a key exists in the cache.

@param string $key The key of the cache item.
@return bool TRUE if the cache item exists in the cache, FALSE otherwise.
Returns information whether a key exists in the cache .