From 9c027176f575c35957da697c0cfe018cdecd2800 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sun, 18 Dec 2022 23:02:48 +0100 Subject: [PATCH] Document tuple return type of generateCacheKeys() --- src/Cache/QueryCacheProfile.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Cache/QueryCacheProfile.php b/src/Cache/QueryCacheProfile.php index e1476112ef3..1601a98286f 100644 --- a/src/Cache/QueryCacheProfile.php +++ b/src/Cache/QueryCacheProfile.php @@ -113,7 +113,7 @@ public function getCacheKey() * @param array|array $types * @param array $connectionParams * - * @return string[] + * @return array{string, string} */ public function generateCacheKeys($sql, $params, $types, array $connectionParams = []) { @@ -127,11 +127,7 @@ public function generateCacheKeys($sql, $params, $types, array $connectionParams '&connectionParams=' . hash('sha256', serialize($connectionParams)); // should the key be automatically generated using the inputs or is the cache key set? - if ($this->cacheKey === null) { - $cacheKey = sha1($realCacheKey); - } else { - $cacheKey = $this->cacheKey; - } + $cacheKey = $this->cacheKey ?? sha1($realCacheKey); return [$cacheKey, $realCacheKey]; }