File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,8 @@ class FileTypeMapper
5151 /** @var (true|callable(): NameScope|NameScope)[][] */
5252 private array $ inProcess = [];
5353
54+ private int $ inProcessCount = 0 ;
55+
5456 /** @var array<string, ResolvedPhpDocBlock> */
5557 private array $ resolvedPhpDocBlockCache = [];
5658
@@ -104,7 +106,22 @@ public function getResolvedPhpDoc(
104106 return ResolvedPhpDocBlock::createEmpty ();
105107 }
106108
109+ if ($ this ->inProcessCount >= 2048 ) {
110+ foreach ($ this ->inProcess as $ file => $ nameScopes ) {
111+ foreach ($ nameScopes as $ key => $ nameScope ) {
112+ if ($ nameScope === true ) {
113+ continue ;
114+ }
115+
116+ unset($ this ->inProcess [$ file ][$ key ]);
117+ $ this ->inProcessCount --;
118+ break ;
119+ }
120+ }
121+ }
122+
107123 $ this ->inProcess [$ fileName ][$ nameScopeKey ] = $ nameScopeMap [$ nameScopeKey ];
124+ $ this ->inProcessCount ++;
108125 }
109126
110127 if ($ this ->inProcess [$ fileName ][$ nameScopeKey ] === true ) { // PHPDoc has cyclic dependency
You can’t perform that action at this time.
0 commit comments