@@ -106,7 +106,8 @@ public function set($key, $value, $ttl = null): bool
106106 }
107107
108108 try {
109- $ this ->db ->createCommand ()
109+ $ this ->db
110+ ->createCommand ()
110111 ->upsert ($ this ->table , $ this ->buildDataRow ($ key , $ ttl , $ value , true ))
111112 ->noCache ()
112113 ->execute ()
@@ -169,7 +170,8 @@ public function setMultiple($values, $ttl = null): bool
169170 $ this ->deleteData ($ keys );
170171
171172 if (!empty ($ rows ) && !$ this ->isExpiredTtl ($ ttl )) {
172- $ this ->db ->createCommand ()
173+ $ this ->db
174+ ->createCommand ()
173175 ->batchInsert ($ this ->table , ['id ' , 'expire ' , 'data ' ], $ rows )
174176 ->noCache ()
175177 ->execute ()
@@ -238,7 +240,11 @@ private function deleteData($id): void
238240
239241 try {
240242 $ condition = $ id === true ? '' : ['id ' => $ id ];
241- $ this ->db ->createCommand ()->delete ($ this ->table , $ condition )->noCache ()->execute ();
243+ $ this ->db
244+ ->createCommand ()
245+ ->delete ($ this ->table , $ condition )
246+ ->noCache ()
247+ ->execute ();
242248 } catch (Throwable $ e ) {
243249 throw new CacheException ('Unable to delete cache data. ' , 0 , $ e );
244250 }
@@ -274,7 +280,8 @@ private function buildDataRow(string $id, ?int $ttl, $value, bool $associative):
274280 private function gc (): void
275281 {
276282 if (random_int (0 , 1000000 ) < $ this ->gcProbability ) {
277- $ this ->db ->createCommand ()
283+ $ this ->db
284+ ->createCommand ()
278285 ->delete ($ this ->table , ['AND ' , ['> ' , 'expire ' , 0 ], ['< ' , 'expire ' , time ()]])
279286 ->execute ()
280287 ;
@@ -295,7 +302,9 @@ private function normalizeTtl($ttl): ?int
295302 }
296303
297304 if ($ ttl instanceof DateInterval) {
298- return (new DateTime ('@0 ' ))->add ($ ttl )->getTimestamp ();
305+ return (new DateTime ('@0 ' ))
306+ ->add ($ ttl )
307+ ->getTimestamp ();
299308 }
300309
301310 return (int ) $ ttl ;
0 commit comments