@@ -21,20 +21,6 @@ class DocumentMetadataCollector implements WarmableInterface
21
21
*/
22
22
const OBJECTS_CACHE_KEY_PREFIX = 'sfes.object_properties_metadata. ' ;
23
23
24
- /**
25
- * <document_class_FQN> => DocumentMetadata
26
- *
27
- * @var array
28
- */
29
- private $ metadata = [];
30
-
31
- /**
32
- * <object_class_FQN> => [<properties_metadata>]
33
- *
34
- * @var array
35
- */
36
- private $ objectsMetadata = [];
37
-
38
24
/**
39
25
* @var array
40
26
*
@@ -129,16 +115,11 @@ public function getDocumentMetadata(string $documentClass): DocumentMetadata
129
115
{
130
116
$ documentClass = $ this ->documentLocator ->resolveClassName ($ documentClass );
131
117
132
- if (isset ($ this ->metadata [$ documentClass ])) {
133
- return $ this ->metadata [$ documentClass ];
134
- }
135
-
136
118
$ cacheKey = self ::DOCUMENTS_CACHE_KEY_PREFIX .strtr ($ documentClass , '\\' , '. ' );
137
- $ this ->metadata [$ documentClass ] = $ this ->cache ->get ($ cacheKey , function (ItemInterface $ item ) use ($ documentClass ) {
119
+
120
+ return $ this ->cache ->get ($ cacheKey , function (ItemInterface $ item ) use ($ documentClass ) {
138
121
return $ this ->fetchDocumentMetadata ($ documentClass );
139
122
}, 0 );
140
-
141
- return $ this ->metadata [$ documentClass ];
142
123
}
143
124
144
125
/**
@@ -155,16 +136,11 @@ public function getObjectPropertiesMetadata(string $objectClass): array
155
136
{
156
137
$ objectClass = $ this ->documentLocator ->resolveClassName ($ objectClass );
157
138
158
- if (isset ($ this ->objectsMetadata [$ objectClass ])) {
159
- return $ this ->objectsMetadata [$ objectClass ];
160
- }
161
-
162
139
$ cacheKey = self ::OBJECTS_CACHE_KEY_PREFIX .strtr ($ objectClass , '\\' , '. ' );
163
- $ this ->objectsMetadata [$ objectClass ] = $ this ->cache ->get ($ cacheKey , function (ItemInterface $ item ) use ($ objectClass ) {
140
+
141
+ return $ this ->cache ->get ($ cacheKey , function (ItemInterface $ item ) use ($ objectClass ) {
164
142
return $ this ->parser ->getPropertiesMetadata (new \ReflectionClass ($ objectClass ));
165
143
}, 0 );
166
-
167
- return $ this ->objectsMetadata [$ objectClass ];
168
144
}
169
145
170
146
/**
0 commit comments