1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-30 04:19:30 +01:00

Fix NameResolver to properly copy attributes

This commit is contained in:
nikic 2012-05-04 10:18:50 +02:00
parent 2f5ebf7c4d
commit 101a6ddcfc

View File

@ -104,7 +104,7 @@ class PHPParser_NodeVisitor_NameResolver extends PHPParser_NodeVisitorAbstract
$name->prepend($this->namespace);
}
return new PHPParser_Node_Name_FullyQualified($name->parts, $name->getLine());
return new PHPParser_Node_Name_FullyQualified($name->parts, $name->getAttributes());
}
protected function resolveOtherName(PHPParser_Node_Name $name) {
@ -122,7 +122,7 @@ class PHPParser_NodeVisitor_NameResolver extends PHPParser_NodeVisitorAbstract
$name->prepend($this->namespace);
}
return new PHPParser_Node_Name_FullyQualified($name->parts, $name->getLine());
return new PHPParser_Node_Name_FullyQualified($name->parts, $name->getAttributes());
}
protected function addNamespacedName(PHPParser_Node $node) {
@ -130,7 +130,7 @@ class PHPParser_NodeVisitor_NameResolver extends PHPParser_NodeVisitorAbstract
$node->namespacedName = clone $this->namespace;
$node->namespacedName->append($node->name);
} else {
$node->namespacedName = new PHPParser_Node_Name($node->name, $node->getLine());
$node->namespacedName = new PHPParser_Node_Name($node->name, $node->getAttributes());
}
}
}