Menu

## FullyQualified extends Name
in package

FullyQualified.php : 5

### Table of Contents

$parts : array<string|int, string>
$attributes : mixed
$specialClassNames : mixed
__construct() : mixed
  Creates a Node.
__toString() : string
  Returns a string representation of the name by imploding the namespace parts with the namespace separator.
concat() : static|null
  Concatenate two names, yielding a new Name instance.
getAttribute() : mixed
  Returns the value of an attribute.
getAttributes() : array<string|int, mixed>
  Returns all the attributes of this node.
getComments() : array<string|int, Comment>
  Gets all comments directly preceding this node.
getDocComment() : null|Doc
  Gets the doc comment of the node.
getEndFilePos() : int
  Gets the file offset of the last character that is part of this node.
getEndLine() : int
  Gets the line the node ended in.
getEndTokenPos() : int
  Gets the token offset of the last token that is part of this node.
getFirst() : string
  Gets the first part of the name, i.e. everything before the first namespace separator.
getLast() : string
  Gets the last part of the name, i.e. everything after the last namespace separator.
getLine() : int
  Gets line the node started in (alias of getStartLine).
getStartFilePos() : int
  Gets the file offset of the first character that is part of this node.
getStartLine() : int
  Gets line the node started in.
getStartTokenPos() : int
  Gets the token offset of the first token that is part of this node.
getSubNodeNames() : array<string|int, mixed>
getType() : string
hasAttribute() : bool
  Returns whether an attribute exists.
isFullyQualified() : bool
  Checks whether the name is fully qualified. (E.g. \Name)
isQualified() : bool
  Checks whether the name is qualified. (E.g. Name\Name)
isRelative() : bool
  Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name)
isSpecialClassName() : bool
  Checks whether the identifier is a special class name (self, parent or static).
isUnqualified() : bool
  Checks whether the name is unqualified. (E.g. Name)
jsonSerialize() : array<string|int, mixed>
setAttribute() : mixed
  Sets an attribute on a node.
setAttributes() : mixed
  Replaces all the attributes of this node.
setDocComment() : mixed
  Sets the doc comment of the node.
slice() : static|null
  Gets a slice of a name (similar to array_slice).
toCodeString() : string
  Returns a string representation of the name as it would occur in code (e.g., including leading backslash for fully qualified names.
toLowerString() : string
  Returns lowercased string representation of the name, without taking the name type into account (e.g., no leading backslash for fully qualified names).
toString() : string
  Returns a string representation of the name itself, without taking the name type into account (e.g., not including a leading backslash for fully qualified names).
prepareName() : array<string|int, string>
  Prepares a (string, array or Name node) name for use in name changing methods by converting it to an array.

### Properties

#### $parts

Name.php : 10
`public array<string|int, string> $parts`

Parts of the name

#### $attributes

NodeAbstract.php : 7
`protected mixed $attributes`

#### $specialClassNames

Name.php : 12
`private static mixed $specialClassNames = ['self' => true, 'parent' => true, 'static' => true]`

### Methods

#### __construct()

NodeAbstract.php : 14

Creates a Node.

`public __construct([array<string|int, mixed> $attributes = [] ]) : mixed`

##### Parameters

$attributes : array<string|int, mixed> = []

  Array of attributes

##### Return values

mixed —

#### __toString()

Name.php : 133

Returns a string representation of the name by imploding the namespace parts with the namespace separator.

`public __toString() : string`

##### Return values

string —

String representation

#### concat()

Name.php : 195

Concatenate two names, yielding a new Name instance.

`public static concat(string|array<string|int, string>|self|null $name1, string|array<string|int, string>|self|null $name2[, array<string|int, mixed> $attributes = [] ]) : static|null`

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.

##### Parameters

$name1 : string|array<string|int, string>|self|null

  The first name

$name2 : string|array<string|int, string>|self|null

  The second name

$attributes : array<string|int, mixed> = []

  Attributes to assign to concatenated name

##### Return values

static|null —

Concatenated name

#### getAttribute()

NodeAbstract.php : 156

Returns the value of an attribute.

`public getAttribute(string $key[, mixed $default = null ]) : mixed`

##### Parameters

$key : string
$default : mixed = null

##### Return values

mixed —

#### getAttributes()

NodeAbstract.php : 164

Returns all the attributes of this node.

`public getAttributes() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

#### getComments()

NodeAbstract.php : 104

Gets all comments directly preceding this node.

`public getComments() : array<string|int, Comment>`

The comments are also available through the "comments" attribute.

##### Return values

array<string|int, Comment> —

#### getDocComment()

NodeAbstract.php : 113

Gets the doc comment of the node.

`public getDocComment() : null|Doc`

##### Return values

null|Doc —

Doc comment object or null

#### getEndFilePos()

NodeAbstract.php : 93

Gets the file offset of the last character that is part of this node.

`public getEndFilePos() : int`

Requires the 'endFilePos' attribute to be enabled in the lexer (DISABLED by default).

##### Return values

int —

File end position (or -1 if not available)

#### getEndLine()

NodeAbstract.php : 45

Gets the line the node ended in.

`public getEndLine() : int`

Requires the 'endLine' attribute to be enabled in the lexer (enabled by default).

##### Return values

int —

End line (or -1 if not available)

#### getEndTokenPos()

NodeAbstract.php : 71

Gets the token offset of the last token that is part of this node.

`public getEndTokenPos() : int`

The offset is an index into the array returned by Lexer::getTokens().

Requires the 'endTokenPos' attribute to be enabled in the lexer (DISABLED by default).

##### Return values

int —

Token end position (or -1 if not available)

#### getFirst()

Name.php : 38

Gets the first part of the name, i.e. everything before the first namespace separator.

`public getFirst() : string`

##### Return values

string —

First part of the name

#### getLast()

Name.php : 47

Gets the last part of the name, i.e. everything after the last namespace separator.

`public getLast() : string`

##### Return values

string —

Last part of the name

#### getLine()

NodeAbstract.php : 23

Gets line the node started in (alias of getStartLine).

`public getLine() : int`

##### Return values

int —

Start line (or -1 if not available)

#### getStartFilePos()

NodeAbstract.php : 82

Gets the file offset of the first character that is part of this node.

`public getStartFilePos() : int`

Requires the 'startFilePos' attribute to be enabled in the lexer (DISABLED by default).

##### Return values

int —

File start position (or -1 if not available)

#### getStartLine()

NodeAbstract.php : 34

Gets line the node started in.

`public getStartLine() : int`

Requires the 'startLine' attribute to be enabled in the lexer (enabled by default).

##### Return values

int —

Start line (or -1 if not available)

#### getStartTokenPos()

NodeAbstract.php : 58

Gets the token offset of the first token that is part of this node.

`public getStartTokenPos() : int`

The offset is an index into the array returned by Lexer::getTokens().

Requires the 'startTokenPos' attribute to be enabled in the lexer (DISABLED by default).

##### Return values

int —

Token start position (or -1 if not available)

#### getSubNodeNames()

Name.php : 29
`public getSubNodeNames() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

#### getType()

FullyQualified.php : 47
`public getType() : string`

##### Return values

string —

#### hasAttribute()

NodeAbstract.php : 152

Returns whether an attribute exists.

`public hasAttribute(string $key) : bool`

##### Parameters

$key : string

##### Return values

bool —

#### isFullyQualified()

FullyQualified.php : 30

Checks whether the name is fully qualified. (E.g. \Name)

`public isFullyQualified() : bool`

##### Return values

bool —

Whether the name is fully qualified

#### isQualified()

FullyQualified.php : 21

Checks whether the name is qualified. (E.g. Name\Name)

`public isQualified() : bool`

##### Return values

bool —

Whether the name is qualified

#### isRelative()

FullyQualified.php : 39

Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\Name)

`public isRelative() : bool`

##### Return values

bool —

Whether the name is relative

#### isSpecialClassName()

Name.php : 122

Checks whether the identifier is a special class name (self, parent or static).

`public isSpecialClassName() : bool`

##### Return values

bool —

Whether identifier is a special class name

#### isUnqualified()

FullyQualified.php : 12

Checks whether the name is unqualified. (E.g. Name)

`public isUnqualified() : bool`

##### Return values

bool —

Whether the name is unqualified

#### jsonSerialize()

NodeAbstract.php : 175
`public jsonSerialize() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

#### setAttribute()

NodeAbstract.php : 148

Sets an attribute on a node.

`public setAttribute(string $key, mixed $value) : mixed`

##### Parameters

$key : string
$value : mixed

##### Return values

mixed —

#### setAttributes()

NodeAbstract.php : 168

Replaces all the attributes of this node.

`public setAttributes(array<string|int, mixed> $attributes) : mixed`

##### Parameters

$attributes : array<string|int, mixed>

##### Return values

mixed —

#### setDocComment()

NodeAbstract.php : 132

Sets the doc comment of the node.

`public setDocComment(Doc $docComment) : mixed`

This will either replace an existing doc comment or add it to the comments array.

##### Parameters

$docComment : Doc

  Doc comment to set

##### Return values

mixed —

#### slice()

Name.php : 153

Gets a slice of a name (similar to array_slice).

`public slice(int $offset[, int|null $length = null ]) : static|null`

This method returns a new instance of the same type as the original and with the same attributes.

If the slice is empty, null is returned. The null value will be correctly handled in concatenations using concat().

Offset and length have the same meaning as in array_slice().

##### Parameters

$offset : int

  Offset to start the slice at (may be negative)

$length : int|null = null

  Length of the slice (may be negative)

##### Return values

static|null —

Sliced name

#### toCodeString()

FullyQualified.php : 43

Returns a string representation of the name as it would occur in code (e.g., including leading backslash for fully qualified names.

`public toCodeString() : string`

##### Return values

string —

String representation

#### toLowerString()

Name.php : 113

Returns lowercased string representation of the name, without taking the name type into account (e.g., no leading backslash for fully qualified names).

`public toLowerString() : string`

##### Return values

string —

Lowercased string representation

#### toString()

Name.php : 93

Returns a string representation of the name itself, without taking the name type into account (e.g., not including a leading backslash for fully qualified names).

`public toString() : string`

##### Return values

string —

String representation

#### prepareName()

Name.php : 217

Prepares a (string, array or Name node) name for use in name changing methods by converting it to an array.

`private static prepareName(string|array<string|int, string>|self $name) : array<string|int, string>`

##### Parameters

$name : string|array<string|int, string>|self

  Name to prepare

##### Return values

array<string|int, string> —

Prepared name

## Search results