mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2025-01-22 05:11:39 +01:00
Allow to pass a string to the constructor of Node_Name
This commit is contained in:
parent
f67ff50550
commit
818eb3940b
@ -13,12 +13,16 @@ class PHPParser_Node_Name extends PHPParser_NodeAbstract
|
||||
/**
|
||||
* Constructs a name node.
|
||||
*
|
||||
* @param array $parts Parts of the name
|
||||
* @param int $type Resolve type
|
||||
* @param int $line Line
|
||||
* @param null|string $docComment Nearest doc comment
|
||||
* @param string|array $parts Parts of the name (or name as string)
|
||||
* @param int $type Resolve type
|
||||
* @param int $line Line
|
||||
* @param null|string $docComment Nearest doc comment
|
||||
*/
|
||||
public function __construct(array $parts, $type = self::NORMAL, $line = -1, $docComment = null) {
|
||||
public function __construct($parts, $type = self::NORMAL, $line = -1, $docComment = null) {
|
||||
if (!is_array($parts)) {
|
||||
$parts = explode('\\', $parts);
|
||||
}
|
||||
|
||||
parent::__construct(
|
||||
array(
|
||||
'parts' => $parts,
|
||||
|
Loading…
x
Reference in New Issue
Block a user