@@ -127,7 +127,7 @@ protected function driverConnect(): bool
127127 protected function driverRead (ExtendedCacheItemInterface $ item ): ?array
128128 {
129129 try {
130- $ options = new Cassandra \ ExecutionOptions (
130+ $ options = $ this -> getCompatibleExecutionOptionsArgument (
131131 [
132132 'arguments ' => ['cache_id ' => $ item ->getKey ()],
133133 'page_size ' => 1 ,
@@ -161,7 +161,7 @@ protected function driverWrite(ExtendedCacheItemInterface $item): bool
161161
162162 try {
163163 $ cacheData = $ this ->encode ($ this ->driverPreWrap ($ item ));
164- $ options = new Cassandra \ ExecutionOptions (
164+ $ options = $ this -> getCompatibleExecutionOptionsArgument (
165165 [
166166 'arguments ' => [
167167 'cache_uuid ' => new Cassandra \Uuid ('' ),
@@ -214,7 +214,7 @@ protected function driverDelete(ExtendedCacheItemInterface $item): bool
214214 $ this ->assertCacheItemType ($ item , Item::class);
215215
216216 try {
217- $ options = new Cassandra \ ExecutionOptions (
217+ $ options = $ this -> getCompatibleExecutionOptionsArgument (
218218 [
219219 'arguments ' => [
220220 'cache_id ' => $ item ->getKey (),
@@ -304,4 +304,17 @@ public function getStats(): DriverStatistic
304304 ->setData (implode (', ' , array_keys ($ this ->itemInstances )))
305305 ->setInfo ('The cache size represents only the cache data itself without counting data structures associated to the cache entries. ' );
306306 }
307+
308+ /**
309+ * @param array<string, mixed> $options
310+ * @return array<string, mixed>|Cassandra\ExecutionOptions
311+ */
312+ protected function getCompatibleExecutionOptionsArgument (array $ options ): mixed
313+ {
314+ if ($ this ->getConfig ()->isUseLegacyExecutionOptions ()) {
315+ return new Cassandra \ExecutionOptions ($ options );
316+ }
317+
318+ return $ options ;
319+ }
307320}
0 commit comments