mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Fix #4083 - namespace docblock method classes the proper way
This commit is contained in:
parent
c045c1b077
commit
e5e50926d4
@ -1123,7 +1123,9 @@ class CommentAnalyzer
|
|||||||
'Badly-formatted @method string ' . $method_entry . ' - ' . $e
|
'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->variadic ? '...' : '')
|
||||||
. $method_tree_child->name;
|
. $method_tree_child->name;
|
||||||
}
|
}
|
||||||
|
@ -694,6 +694,21 @@ class MagicMethodAnnotationTest extends TestCase
|
|||||||
(new \Foo\G)->randomInt();
|
(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…
Reference in New Issue
Block a user