Skip to content

Commit

Permalink
Merge branch '3.5.x' into 4.0.x
Browse files Browse the repository at this point in the history
* 3.5.x:
  Document tuple return type of generateCacheKeys()
  • Loading branch information
derrabus committed Dec 28, 2022
2 parents c66f662 + 63e513c commit af57bbf
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Cache/QueryCacheProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function getCacheKey(): string
* @param array<int, int|string|ParameterType|Type>|array<string, int|string|ParameterType|Type> $types
* @param array<string, mixed> $connectionParams
*
* @return string[]
* @return array{string, string}
*/
public function generateCacheKeys(string $sql, array $params, array $types, array $connectionParams = []): array
{
Expand All @@ -68,11 +68,7 @@ public function generateCacheKeys(string $sql, array $params, array $types, arra
'&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];
}
Expand Down

0 comments on commit af57bbf

Please sign in to comment.