From 735e49a9c9165c872e7b2ef57763ec3c83cdd1d6 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Sat, 17 Feb 2024 12:22:40 +0300 Subject: [PATCH] fix --- CHANGELOG.md | 1 - psalm.xml | 1 - src/Memcached.php | 10 +--------- tests/MemcachedTest.php | 9 --------- 4 files changed, 1 insertion(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 318c905..552b6cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,6 @@ - Enh #62: Remove not need casting to array in private method `Memcached::iterableToArray()` (@vjik) - Enh #62: Improve list of memcached server validation (@vjik) -- Enh #62: Check key type when multiple keys passed (@vjik) ## 2.0.0 February 15, 2023 diff --git a/psalm.xml b/psalm.xml index 5c09352..b48c894 100644 --- a/psalm.xml +++ b/psalm.xml @@ -13,7 +13,6 @@ - diff --git a/src/Memcached.php b/src/Memcached.php index 3dbdc74..93a3ff5 100644 --- a/src/Memcached.php +++ b/src/Memcached.php @@ -270,19 +270,11 @@ private function validateKey(string $key): void } /** - * @psalm-assert string[] $keys + * @param string[] $keys */ private function validateKeys(array $keys): void { foreach ($keys as $key) { - if (!is_string($key)) { - throw new InvalidArgumentException( - sprintf( - 'Invalid key type. Expected string, got %s.', - get_debug_type($key) - ) - ); - } $this->validateKey($key); } } diff --git a/tests/MemcachedTest.php b/tests/MemcachedTest.php index 601f0fd..b836659 100644 --- a/tests/MemcachedTest.php +++ b/tests/MemcachedTest.php @@ -219,15 +219,6 @@ public function testGetMultiple(): void $this->assertSameExceptObject($data, $cache->getMultiple(array_map('\strval', array_keys($data)))); } - public function testGetMultipleWithNotStringKey() - { - $cache = $this->createCacheInstance(); - - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid key type. Expected string, got int.'); - $cache->getMultiple(['test', 1]); - } - public function testDeleteMultiple(): void { $cache = $this->createCacheInstance();