original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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.
docstring_tokens: Returns information whether a key exists in the cache .