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