Skip to content

Commit e93a9d1

Browse files
author
abluchet
committed
Subresource cache fix psr-6 compliance
1 parent 555cca6 commit e93a9d1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Operation/Factory/CachedSubresourceOperationFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(CacheItemPoolInterface $cacheItemPool, SubresourceOp
3737
*/
3838
public function create(string $resourceClass): array
3939
{
40-
$cacheKey = self::CACHE_KEY_PREFIX.str_replace('\\', '', $resourceClass);
40+
$cacheKey = self::CACHE_KEY_PREFIX.md5($resourceClass);
4141

4242
try {
4343
$cacheItem = $this->cacheItemPool->getItem($cacheKey);

tests/Operation/Factory/CachedSubresourceOperationFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@ public function testCreateWithGetCacheItemThrowsCacheException()
8181

8282
private function generateCacheKey(string $resourceClass = Dummy::class)
8383
{
84-
return CachedSubresourceOperationFactory::CACHE_KEY_PREFIX.str_replace('\\', '', $resourceClass);
84+
return CachedSubresourceOperationFactory::CACHE_KEY_PREFIX.md5($resourceClass);
8585
}
8686
}

0 commit comments

Comments
 (0)