@@ -91,7 +91,7 @@ public static function resolve(TypeNode $node, \ReflectionClass|\ReflectionFunct
9191
9292 if ($ node instanceof GenericTypeNode) {
9393 $ genericType = self ::resolve ($ node ->type , $ ref , $ thisObj );
94- $ innerTypes = array_map (fn ($ t ) => self ::resolve ($ t , $ ref , $ thisObj ), $ node ->genericTypes );
94+ $ innerTypes = array_map (fn ($ t ) => self ::resolve ($ t , $ ref , $ thisObj ), $ node ->genericTypes );
9595
9696 return new GenericTypeNode (
9797 $ genericType instanceof IdentifierTypeNode ? $ genericType : $ node ->type ,
@@ -145,11 +145,11 @@ public static function resolve(TypeNode $node, \ReflectionClass|\ReflectionFunct
145145 }
146146
147147 if ($ node instanceof UnionTypeNode) {
148- return new UnionTypeNode (array_map (fn ($ t ) => self ::resolve ($ t , $ ref , $ thisObj ), $ node ->types ));
148+ return new UnionTypeNode (array_map (fn ($ t ) => self ::resolve ($ t , $ ref , $ thisObj ), $ node ->types ));
149149 }
150150
151151 if ($ node instanceof IntersectionTypeNode) {
152- return new IntersectionTypeNode (array_map (fn ($ t ) => self ::resolve ($ t , $ ref , $ thisObj ), $ node ->types ));
152+ return new IntersectionTypeNode (array_map (fn ($ t ) => self ::resolve ($ t , $ ref , $ thisObj ), $ node ->types ));
153153 }
154154
155155 return $ node ;
@@ -181,7 +181,7 @@ public static function resolveForFile(TypeNode $node, string $file): TypeNode
181181
182182 if ($ node instanceof GenericTypeNode) {
183183 $ genericType = self ::resolveForFile ($ node ->type , $ file );
184- $ innerTypes = array_map (fn ($ t ) => self ::resolveForFile ($ t , $ file ), $ node ->genericTypes );
184+ $ innerTypes = array_map (fn ($ t ) => self ::resolveForFile ($ t , $ file ), $ node ->genericTypes );
185185
186186 return new GenericTypeNode (
187187 $ genericType instanceof IdentifierTypeNode ? $ genericType : $ node ->type ,
@@ -235,11 +235,11 @@ public static function resolveForFile(TypeNode $node, string $file): TypeNode
235235 }
236236
237237 if ($ node instanceof UnionTypeNode) {
238- return new UnionTypeNode (array_map (fn ($ t ) => self ::resolveForFile ($ t , $ file ), $ node ->types ));
238+ return new UnionTypeNode (array_map (fn ($ t ) => self ::resolveForFile ($ t , $ file ), $ node ->types ));
239239 }
240240
241241 if ($ node instanceof IntersectionTypeNode) {
242- return new IntersectionTypeNode (array_map (fn ($ t ) => self ::resolveForFile ($ t , $ file ), $ node ->types ));
242+ return new IntersectionTypeNode (array_map (fn ($ t ) => self ::resolveForFile ($ t , $ file ), $ node ->types ));
243243 }
244244
245245 return clone $ node ;
@@ -361,32 +361,13 @@ private static function resolveArrayShape(ArrayShapeNode $node, \ReflectionClass
361361 $ className = null ;
362362 $ constName = null ;
363363
364- // --- LIVE CI DEBUG LOGGING ---
365- $ debugClass = $ keyName !== null ? get_class ($ keyName ) : 'null ' ;
366- $ debugVal = $ keyName !== null && method_exists ($ keyName , '__toString ' ) ? (string ) $ keyName : 'unknown ' ;
367- fwrite (\STDERR , "\n[DEBUG] ArrayShapeItem KeyType: {$ debugClass } | Value: {$ debugVal }\n" );
368-
369- if ($ keyName instanceof IdentifierTypeNode) {
370- fwrite (\STDERR , "[DEBUG] IdentifierName: {$ keyName ->name }\n" );
371- }
372- // -----------------------------
373-
374364 if ($ keyName instanceof ConstFetchNode && $ keyName ->className !== '' ) {
375365 $ className = $ keyName ->className ;
376366 $ constName = $ keyName ->name ;
377367 } elseif ($ keyName instanceof IdentifierTypeNode && str_contains ($ keyName ->name , ':: ' )) {
378- // Fallback for phpstan/phpdoc-parser v1.x/v2.0 which parses constants as Identifiers
379368 [$ className , $ constName ] = explode (':: ' , $ keyName ->name , 2 );
380369 }
381370
382- // --- MORE DEBUG LOGGING ---
383- if ($ className !== null && $ constName !== null ) {
384- fwrite (\STDERR , "[DEBUG] Split into Class: {$ className } | Const: {$ constName }\n" );
385- } else {
386- fwrite (\STDERR , "[DEBUG] Did NOT split into Class and Const. \n" );
387- }
388- // --------------------------
389-
390371 if ($ className !== null && $ constName !== null ) {
391372 $ lowerClassName = strtolower ($ className );
392373 $ declaringClass = $ ref instanceof \ReflectionMethod ? $ ref ->getDeclaringClass ()->getName () : null ;
@@ -400,14 +381,9 @@ private static function resolveArrayShape(ArrayShapeNode $node, \ReflectionClass
400381 $ resolvedClass = self ::resolveFqcn ($ className , $ ref );
401382 }
402383
403- fwrite (\STDERR , "[DEBUG] Resolved Target Class for Reflection: {$ resolvedClass }\n" );
404-
405384 $ resolvedKeyNode = self ::resolveConstantKeyValue ($ resolvedClass , $ constName );
406385 if ($ resolvedKeyNode !== null ) {
407- fwrite (\STDERR , "[DEBUG] Successfully Reflected Constant! New Value: {$ resolvedKeyNode ->value }\n" );
408386 $ keyName = $ resolvedKeyNode ;
409- } else {
410- fwrite (\STDERR , "[DEBUG] FAILED to Reflect Constant! \n" );
411387 }
412388 }
413389
0 commit comments