Skip to content

Commit

Permalink
add cache prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangut committed Sep 28, 2023
1 parent e652eb5 commit 44f0143
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Metadata/MetadataResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*/
class MetadataResolver
{
protected string $cachePrefix = '';

/**
* @param CacheInterface<mixed>|null $cache
*/
Expand All @@ -29,6 +31,11 @@ public function __construct(
protected ?CacheInterface $cache = null,
) {}

public function setCachePrefix(string $cachePrefix): void
{
$this->cachePrefix = $cachePrefix;
}

/**
* @param array<Source> $mappingSources
*
Expand Down Expand Up @@ -86,7 +93,7 @@ static function (array $mappingSource): string {
),
);

return hash('sha256', $key);
return $this->cachePrefix . hash('sha256', $key);
}

/**
Expand Down

0 comments on commit 44f0143

Please sign in to comment.