Skip to content

Commit a880f9d

Browse files
committed
fix(cache): add deleteMatching method definition in CacheInterface
fixes #7828
1 parent 2609108 commit a880f9d

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

system/Cache/CacheInterface.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ public function save(string $key, $value, int $ttl = 60);
5151
*/
5252
public function delete(string $key);
5353

54+
/**
55+
* Deletes items from the cache store matching a given pattern.
56+
*
57+
* @param string $pattern Cache items glob-style pattern
58+
*
59+
* @return int
60+
*/
61+
public function deleteMatching(string $pattern);
62+
5463
/**
5564
* Performs atomic incrementation of a raw stored value.
5665
*

system/Cache/Handlers/BaseHandler.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515

1616
use Closure;
1717
use CodeIgniter\Cache\CacheInterface;
18-
use CodeIgniter\Exceptions\BadMethodCallException;
1918
use CodeIgniter\Exceptions\InvalidArgumentException;
2019
use Config\Cache;
21-
use Exception;
2220

2321
/**
2422
* Base class for cache handling
@@ -98,18 +96,4 @@ public function remember(string $key, int $ttl, Closure $callback)
9896

9997
return $value;
10098
}
101-
102-
/**
103-
* Deletes items from the cache store matching a given pattern.
104-
*
105-
* @param string $pattern Cache items glob-style pattern
106-
*
107-
* @return int
108-
*
109-
* @throws Exception
110-
*/
111-
public function deleteMatching(string $pattern)
112-
{
113-
throw new BadMethodCallException('The deleteMatching method is not implemented.');
114-
}
11599
}

0 commit comments

Comments
 (0)