Skip to content

Commit f8d3191

Browse files
authored
Fix #62: Remove the restriction of key prefix to Cache
1 parent 3720747 commit f8d3191

2 files changed

Lines changed: 0 additions & 12 deletions

File tree

src/Cache.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,6 @@ public function getOrSet(string $key, callable $callable, $ttl = null, Dependenc
298298
*/
299299
public function setKeyPrefix(string $keyPrefix): void
300300
{
301-
if ($keyPrefix !== '' && !ctype_alnum($keyPrefix)) {
302-
throw new \Yiisoft\Cache\Exception\InvalidArgumentException('Cache key prefix should be alphanumeric');
303-
}
304301
$this->keyPrefix = $keyPrefix;
305302
}
306303

tests/ArrayCache/ArrayCacheDecoratorExtraTest.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,6 @@ public function testGetWithPrefix(): void
183183
$this->assertSameExceptObject(1, $cache->get('test_integer'));
184184
}
185185

186-
public function testInvalidKeyPrefix(): void
187-
{
188-
$this->expectException(InvalidArgumentException::class);
189-
190-
/** @var Cache $cache */
191-
$cache = $this->createCacheInstance();
192-
$cache->setKeyPrefix('_prefix');
193-
}
194-
195186
public function testKeyPrefix(): void
196187
{
197188
/** @var Cache $cache */

0 commit comments

Comments
 (0)