https://www.phpfastcache.com * @author Georges.L (Geolim4) * */ declare(strict_types=1); namespace Phpfastcache\Cluster; use Phpfastcache\Core\Item\{ExtendedCacheItemInterface, ItemBaseTrait}; use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; use Phpfastcache\Exceptions\{PhpfastcacheInvalidArgumentException}; /** * Class ClusterItem * @package Phpfastcache\Cluster */ abstract class ItemAbstract implements ExtendedCacheItemInterface { use ItemBaseTrait { ItemBaseTrait::__construct as __BaseConstruct; } /** * @param ExtendedCacheItemPoolInterface $driver * @return static * @throws PhpfastcacheInvalidArgumentException */ public function setDriver(ExtendedCacheItemPoolInterface $driver) { if ($driver instanceof ClusterPoolInterface) { $this->driver = $driver; return $this; } throw new PhpfastcacheInvalidArgumentException('Invalid driver instance'); } }