original_string: public function set(CacheItem $item): self
      {
          $driver = $this->getDriver();
          $driver->set($item->key, $item->value, $item->ttl);
          if ($this->hasEventListeners('itemSet')) {
              $this->dispatchEvent('itemSet', new \BearFramework\App\Cache\ItemSetEventDetails(clone($item)));
          }
          if ($this->hasEventListeners('itemChange')) {
              $this->dispatchEvent('itemChange', new \BearFramework\App\Cache\ItemChangeEventDetails($item->key));
          }
          return $this;
      }
code: public function set(CacheItem $item): self
      {
          $driver = $this->getDriver();
          $driver->set($item->key, $item->value, $item->ttl);
          if ($this->hasEventListeners('itemSet')) {
              $this->dispatchEvent('itemSet', new \BearFramework\App\Cache\ItemSetEventDetails(clone($item)));
          }
          if ($this->hasEventListeners('itemChange')) {
              $this->dispatchEvent('itemChange', new \BearFramework\App\Cache\ItemChangeEventDetails($item->key));
          }
          return $this;
      }
code_tokens: public function set ( CacheItem $ item ) : self { $ driver = $ this -> getDriver ( ) ; $ driver -> set ( $ item -> key , $ item -> value , $ item -> ttl ) ; if ( $ this -> hasEventListeners ( 'itemSet' ) ) { $ this -> dispatchEvent ( 'itemSet' , new \ BearFramework \ App \ Cache \ ItemSetEventDetails ( clone ( $ item ) ) ) ; } if ( $ this -> hasEventListeners ( 'itemChange' ) ) { $ this -> dispatchEvent ( 'itemChange' , new \ BearFramework \ App \ Cache \ ItemChangeEventDetails ( $ item -> key ) ) ; } return $ this ; }
docstring: Stores a cache item.
  
  @param \BearFramework\App\CacheItem $item The cache item to store.
  @return self Returns a reference to itself.
docstring_tokens: Stores a cache item .