File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -91,10 +91,10 @@ public function deleteMatching(string $pattern): int
9191 {
9292 $ matchedKeys = array_filter (
9393 array_keys (iterator_to_array (new APCUIterator ())),
94- static fn ($ key ) => fnmatch ($ pattern , $ key ),
94+ static fn ($ key ): bool => fnmatch ($ pattern , $ key ),
9595 );
9696
97- if ($ matchedKeys ) {
97+ if (! empty ( $ matchedKeys) ) {
9898 return count ($ matchedKeys ) - count (apcu_delete ($ matchedKeys ));
9999 }
100100
@@ -142,9 +142,10 @@ public function getCacheInfo(): array|false|object|null
142142 */
143143 public function getMetaData (string $ key ): ?array
144144 {
145- $ key = static ::validateKey ($ key , $ this ->prefix );
145+ $ key = static ::validateKey ($ key , $ this ->prefix );
146+ $ metadata = apcu_key_info ($ key );
146147
147- if ($ metadata = apcu_key_info ( $ key )) {
148+ if (! empty ( $ metadata )) {
148149 return [
149150 'expire ' => $ metadata ['ttl ' ] > 0 ? Time::now ()->getTimestamp () + $ metadata ['ttl ' ] : null ,
150151 'mtime ' => $ metadata ['mtime ' ],
You can’t perform that action at this time.
0 commit comments