File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -90,11 +90,11 @@ public function delete(string $key): bool
9090 public function deleteMatching (string $ pattern ): int
9191 {
9292 $ matchedKeys = array_filter (
93- array_keys (iterator_to_array (new APCUIterator ())),
94- static fn ($ key ) => fnmatch ($ pattern , $ key ),
93+ array_keys (iterator_to_array (new APCUIterator (null , APC_ITER_KEY ))),
94+ static fn ($ key ): bool => fnmatch ($ pattern , $ key ),
9595 );
9696
97- if ($ matchedKeys ) {
97+ if ($ 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 ($ metadata !== null ) {
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