The type of the generated instance depends on which class this method is called on, for
example Name\FullyQualified::concat() will yield a Name\FullyQualified instance.
If one of the arguments is null, a new instance of the other name will be returned. If both
arguments are null, null will be returned. As such, writing
Name::concat($namespace, $shortName)
where $namespace is a Name node or null will work as expected.
public static concat ( string | array | self | null $name1, string | array | self | null $name2, array $attributes = [] ) : static | null | ||
$name1 | string | array | self | null | The first name |
$name2 | string | array | self | null | The second name |
$attributes | array | Attributes to assign to concatenated name |
return | static | null | Concatenated name |