@@ -152,15 +152,15 @@ private function resolvePhpDocStringToDocNode(string $phpDocString): PhpDocNode
152
152
} catch (\OutOfBoundsException $ e ) {
153
153
// skip
154
154
}
155
- $ cacheKey = sprintf ('phpdocstring-%s-%s ' , $ phpDocString, $ phpDocParserVersion );
156
- $ phpDocNodeSerializedString = $ this ->cache ->load ($ cacheKey );
155
+ $ cacheKey = sprintf ('phpdocstring-%s ' , $ phpDocString );
156
+ $ phpDocNodeSerializedString = $ this ->cache ->load ($ cacheKey, $ phpDocParserVersion );
157
157
if ($ phpDocNodeSerializedString !== null ) {
158
158
return unserialize ($ phpDocNodeSerializedString );
159
159
}
160
160
161
161
$ phpDocNode = $ this ->phpDocStringResolver ->resolve ($ phpDocString );
162
162
if ($ this ->shouldPhpDocNodeBeCachedToDisk ($ phpDocNode )) {
163
- $ this ->cache ->save ($ cacheKey , serialize ($ phpDocNode ));
163
+ $ this ->cache ->save ($ cacheKey , $ phpDocParserVersion , serialize ($ phpDocNode ));
164
164
}
165
165
166
166
return $ phpDocNode ;
@@ -190,12 +190,13 @@ private function getResolvedPhpDocMap(string $fileName): array
190
190
if ($ modifiedTime === false ) {
191
191
$ modifiedTime = time ();
192
192
}
193
- $ cacheKey = sprintf ('%s-phpdocstring-%d ' , $ fileName , $ modifiedTime );
194
- $ map = $ this ->cache ->load ($ cacheKey );
193
+ $ cacheKey = sprintf ('%s-phpdocstring ' , $ fileName );
194
+ $ modifiedTimeString = sprintf ('%d ' , $ modifiedTime );
195
+ $ map = $ this ->cache ->load ($ cacheKey , $ modifiedTimeString );
195
196
196
197
if ($ map === null ) {
197
198
$ map = $ this ->createResolvedPhpDocMap ($ fileName );
198
- $ this ->cache ->save ($ cacheKey , $ map );
199
+ $ this ->cache ->save ($ cacheKey , $ modifiedTimeString , $ map );
199
200
}
200
201
201
202
$ this ->memoryCache [$ fileName ] = $ map ;
0 commit comments