@@ -33,7 +33,7 @@ final class CachedIdentifiersExtractor implements IdentifiersExtractorInterface
33
33
private $ cacheItemPool ;
34
34
private $ propertyAccessor ;
35
35
private $ decorated ;
36
- private $ memoryCache = [];
36
+ private $ localCache = [];
37
37
38
38
public function __construct (CacheItemPoolInterface $ cacheItemPool , IdentifiersExtractorInterface $ decorated , PropertyAccessorInterface $ propertyAccessor = null )
39
39
{
@@ -64,7 +64,7 @@ public function getIdentifiersFromItem($item): array
64
64
}
65
65
66
66
$ relatedResourceClass = $ this ->getObjectClass ($ identifiers [$ propertyName ]);
67
- if (!$ relatedIdentifiers = $ this ->memoryCache [$ relatedResourceClass ] ?? false ) {
67
+ if (!$ relatedIdentifiers = $ this ->localCache [$ relatedResourceClass ] ?? false ) {
68
68
$ relatedCacheKey = self ::CACHE_KEY_PREFIX .md5 ($ relatedResourceClass );
69
69
try {
70
70
$ relatedCacheItem = $ this ->cacheItemPool ->getItem ($ relatedCacheKey );
@@ -87,14 +87,14 @@ public function getIdentifiersFromItem($item): array
87
87
private function getKeys ($ item , callable $ retriever ): array
88
88
{
89
89
$ resourceClass = $ this ->getObjectClass ($ item );
90
- if (isset ($ this ->memoryCache [$ resourceClass ])) {
91
- return $ this ->memoryCache [$ resourceClass ];
90
+ if (isset ($ this ->localCache [$ resourceClass ])) {
91
+ return $ this ->localCache [$ resourceClass ];
92
92
}
93
93
94
94
try {
95
95
$ cacheItem = $ this ->cacheItemPool ->getItem (self ::CACHE_KEY_PREFIX .md5 ($ resourceClass ));
96
96
if ($ cacheItem ->isHit ()) {
97
- return $ this ->memoryCache [$ resourceClass ] = $ cacheItem ->get ();
97
+ return $ this ->localCache [$ resourceClass ] = $ cacheItem ->get ();
98
98
}
99
99
} catch (CacheException $ e ) {
100
100
// do nothing
@@ -107,6 +107,6 @@ private function getKeys($item, callable $retriever): array
107
107
$ this ->cacheItemPool ->save ($ cacheItem );
108
108
}
109
109
110
- return $ this ->memoryCache [$ resourceClass ] = $ keys ;
110
+ return $ this ->localCache [$ resourceClass ] = $ keys ;
111
111
}
112
112
}
0 commit comments