original_string: public function has(string $key): bool
      {
          if (array_key_exists($key, $this->ttl) &&
              $this->time() - $this->ttl[$key] > 0
          ) {
              unset($this->ttl[$key]);
              unset($this->storage[$key]);
  
              return false;
          }
  
          return array_key_exists($key, $this->storage);
      }
code: public function has(string $key): bool
      {
          if (array_key_exists($key, $this->ttl) &&
              $this->time() - $this->ttl[$key] > 0
          ) {
              unset($this->ttl[$key]);
              unset($this->storage[$key]);
  
              return false;
          }
  
          return array_key_exists($key, $this->storage);
      }
code_tokens: public function has ( string $ key ) : bool { if ( array_key_exists ( $ key , $ this -> ttl ) && $ this -> time ( ) - $ this -> ttl [ $ key ] > 0 ) { unset ( $ this -> ttl [ $ key ] ) ; unset ( $ this -> storage [ $ key ] ) ; return false ; } return array_key_exists ( $ key , $ this -> storage ) ; }
docstring: Determine if an item exists in the cache. This method will also check
  if the ttl of the given cache key has been expired and will free the
  memory if so.
  
  @param string $key cache key of the item
  
  @return bool has cache key
docstring_tokens: Determine if an item exists in the cache . This method will also check if the ttl of the given cache key has been expired and will free the memory if so .