mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Clone all comments, not just docs
This commit is contained in:
parent
6ba76e1589
commit
0d7661dd3f
@ -15,8 +15,19 @@ class CloningVisitor extends NodeVisitorAbstract
|
||||
public function enterNode(Node $origNode)
|
||||
{
|
||||
$node = clone $origNode;
|
||||
if ($c = $node->getDocComment()) {
|
||||
$node->setDocComment(clone $c);
|
||||
if ($cs = $node->getComments()) {
|
||||
$node->setAttribute(
|
||||
'comments',
|
||||
array_map(
|
||||
/**
|
||||
* @return \PhpParser\Comment
|
||||
*/
|
||||
function (\PhpParser\Comment $c) {
|
||||
return clone $c;
|
||||
},
|
||||
$cs
|
||||
)
|
||||
);
|
||||
}
|
||||
return $node;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user