Skip to content

Commit 6db7a82

Browse files
committed
feat: APCu caching driver: improvements
1 parent 8551ed1 commit 6db7a82

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

system/Cache/Handlers/ApcuHandler.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ public function __construct(Cache $config)
3333
$this->prefix = $config->prefix;
3434
}
3535

36-
/**
37-
* {@inheritDoc}
38-
*/
3936
public function initialize(): void
4037
{
4138
}
@@ -104,7 +101,7 @@ public function deleteMatching(string $pattern): int
104101
/**
105102
* {@inheritDoc}
106103
*/
107-
public function increment(string $key, int $offset = 1): bool|int
104+
public function increment(string $key, int $offset = 1): false|int
108105
{
109106
$key = static::validateKey($key, $this->prefix);
110107

@@ -114,7 +111,7 @@ public function increment(string $key, int $offset = 1): bool|int
114111
/**
115112
* {@inheritDoc}
116113
*/
117-
public function decrement(string $key, int $offset = 1): bool|int
114+
public function decrement(string $key, int $offset = 1): false|int
118115
{
119116
$key = static::validateKey($key, $this->prefix);
120117

@@ -132,7 +129,7 @@ public function clean(): bool
132129
/**
133130
* {@inheritDoc}
134131
*/
135-
public function getCacheInfo(): array|false|object|null
132+
public function getCacheInfo(): array|false
136133
{
137134
return apcu_cache_info(true);
138135
}

tests/system/Cache/Handlers/ApcuHandlerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818
use CodeIgniter\I18n\Time;
1919
use Config\Cache;
2020
use PHPUnit\Framework\Attributes\Group;
21+
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
2122

2223
/**
2324
* @internal
2425
*/
2526
#[Group('CacheLive')]
27+
#[RequiresPhpExtension('apcu')]
2628
final class ApcuHandlerTest extends AbstractHandlerTestCase
2729
{
2830
/**

0 commit comments

Comments
 (0)