1212
1313final class ReflectionCache
1414{
15- public const SCHEMA_VERSION = 'v4 -runtime-config ' ;
15+ public const SCHEMA_VERSION = 'v5 -runtime-config-bugfix ' ;
1616
1717 /**
1818 * @var string
@@ -78,9 +78,9 @@ private function lazyReadRecords()
7878 return $ this ->records ;
7979 }
8080
81- $ cache = $ this ->readCache (true );
82- if (null !== $ cache ) {
83- $ this ->records = $ cache [ ' records ' ] ;
81+ $ cachedRecords = $ this ->readCachedRecords (true );
82+ if (null !== $ cachedRecords ) {
83+ $ this ->records = $ cachedRecords ;
8484 } else {
8585 $ this ->records = [];
8686 }
@@ -90,13 +90,9 @@ private function lazyReadRecords()
9090 }
9191
9292 /**
93- * @return array{
94- * records: array<string, array{error?: ?Error, result?: array<QueryReflector::FETCH_TYPE*, ?Type>}>,
95- * runtimeConfig: array<string, scalar>,
96- * schemaVersion: string
97- * }|null
93+ * @return array<string, array{error?: ?Error, result?: array<QueryReflector::FETCH_TYPE*, ?Type>}>|null
9894 */
99- private function readCache (bool $ useReadLock ): ?array
95+ private function readCachedRecords (bool $ useReadLock ): ?array
10096 {
10197 if (!is_file ($ this ->cacheFile )) {
10298 if (false === file_put_contents ($ this ->cacheFile , '' )) {
@@ -127,8 +123,7 @@ private function readCache(bool $useReadLock): ?array
127123 throw new ShouldNotHappenException ();
128124 }
129125
130- // @phpstan-ignore-next-line
131- return $ cache ;
126+ return $ cache ['records ' ];
132127 }
133128
134129 public function persist (): void
@@ -141,7 +136,7 @@ public function persist(): void
141136 flock (self ::$ lockHandle , LOCK_EX );
142137
143138 // freshly read the cache as it might have changed in the meantime
144- $ cachedRecords = $ this ->readCache (false );
139+ $ cachedRecords = $ this ->readCachedRecords (false );
145140
146141 // re-apply all changes to the current cache-state
147142 if (null === $ cachedRecords ) {
0 commit comments