fix: replace \Exception with BadMethodCallException

This commit is contained in:
kenjis 2024-01-27 22:42:41 +09:00
parent 3fa8a26177
commit 3a35769b19
No known key found for this signature in database
GPG Key ID: BD254878922AF198
3 changed files with 6 additions and 4 deletions

View File

@ -15,6 +15,7 @@ namespace CodeIgniter\Cache\Handlers;
use Closure;
use CodeIgniter\Cache\CacheInterface;
use CodeIgniter\Exceptions\BadMethodCallException;
use CodeIgniter\Exceptions\InvalidArgumentException;
use Config\Cache;
use Exception;
@ -108,6 +109,6 @@ abstract class BaseHandler implements CacheInterface
*/
public function deleteMatching(string $pattern)
{
throw new Exception('The deleteMatching method is not implemented.');
throw new BadMethodCallException('The deleteMatching method is not implemented.');
}
}

View File

@ -13,6 +13,7 @@ declare(strict_types=1);
namespace CodeIgniter\Cache\Handlers;
use CodeIgniter\Exceptions\BadMethodCallException;
use CodeIgniter\Exceptions\CriticalError;
use CodeIgniter\I18n\Time;
use Config\Cache;
@ -197,7 +198,7 @@ class MemcachedHandler extends BaseHandler
*/
public function deleteMatching(string $pattern)
{
throw new Exception('The deleteMatching method is not implemented for Memcached. You must select File, Redis or Predis handlers to use it.');
throw new BadMethodCallException('The deleteMatching method is not implemented for Memcached. You must select File, Redis or Predis handlers to use it.');
}
/**

View File

@ -13,9 +13,9 @@ declare(strict_types=1);
namespace CodeIgniter\Cache\Handlers;
use CodeIgniter\Exceptions\BadMethodCallException;
use CodeIgniter\I18n\Time;
use Config\Cache;
use Exception;
/**
* Cache handler for WinCache from Microsoft & IIS.
@ -80,7 +80,7 @@ class WincacheHandler extends BaseHandler
*/
public function deleteMatching(string $pattern)
{
throw new Exception('The deleteMatching method is not implemented for Wincache. You must select File, Redis or Predis handlers to use it.');
throw new BadMethodCallException('The deleteMatching method is not implemented for Wincache. You must select File, Redis or Predis handlers to use it.');
}
/**