We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c79be6d commit 646f4c4Copy full SHA for 646f4c4
tests/StubsTypeHintsTest.php
@@ -500,6 +500,12 @@ public static function testClassesMethodsSignatureTypeHintsConformPhpDocInMethod
500
fn (string $type) => self::handleTemplateTypes($type, $classTemplateTypes),
501
)
502
);
503
+ // Treat PhpDoc 'static' as the declaring class short name (e.g., DateTime)
504
+ $classShortName = self::getTypePossibleNamespace(ltrim($classId, '\\'));
505
+ $unifiedPhpDocTypes = array_map(
506
+ static fn (string $t) => $t === 'static' ? $classShortName : $t,
507
+ $unifiedPhpDocTypes
508
+ );
509
$unifiedSignatureTypes = array_map(self::getTypePossibleNamespace(...), $function->returnTypesFromSignature);
510
if (count($unifiedSignatureTypes) === 1) {
511
$type = array_pop($unifiedSignatureTypes);
0 commit comments