mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Fix #4083 - namespace docblock method classes the proper way
This commit is contained in:
parent
efed9d4480
commit
cf5aa5c5cd
@ -1108,7 +1108,9 @@ class CommentAnalyzer
|
||||
'Badly-formatted @method string ' . $method_entry . ' - ' . $e
|
||||
);
|
||||
}
|
||||
$docblock_lines[] = '@param \\' . $param_type . ' '
|
||||
|
||||
$param_type_string = $param_type->toNamespacedString('\\', [], null, false);
|
||||
$docblock_lines[] = '@param ' . $param_type_string . ' '
|
||||
. ($method_tree_child->variadic ? '...' : '')
|
||||
. $method_tree_child->name;
|
||||
}
|
||||
|
@ -694,6 +694,21 @@ class MagicMethodAnnotationTest extends TestCase
|
||||
(new \Foo\G)->randomInt();
|
||||
}'
|
||||
],
|
||||
'namespacedUnion' => [
|
||||
'<?php
|
||||
namespace Foo;
|
||||
|
||||
/**
|
||||
* @method string bar(\DateTimeInterface|\DateInterval|self $a, Cache|\Exception $e)
|
||||
*/
|
||||
class Cache {
|
||||
public function __call(string $method, array $args) {
|
||||
return $method;
|
||||
}
|
||||
}
|
||||
|
||||
(new Cache)->bar(new \DateTime(), new Cache());'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user