PHP_Token_TRAIT
extends PHP_Token_INTERFACE
in package
A PHP token.
Table of Contents
- $endTokenId : int
- $id : int
- $interfaces : array<string|int, mixed>
- $line : int
- $text : string
- $tokenStream : PHP_Token_Stream
- __construct() : mixed
- Constructor.
- __toString() : string
- getDocblock() : string|null
- Get the docblock for this token
- getEndLine() : int
- getEndTokenId() : int
- getInterfaces() : array<string|int, mixed>|bool
- getKeywords() : string
- getLine() : int
- getName() : string
- getPackage() : array<string|int, mixed>
- getParent() : bool|string
- getVisibility() : string
- hasInterfaces() : bool
- hasParent() : bool
- arrayToName() : string
Properties
$endTokenId
protected
int
$endTokenId
$id
protected
int
$id
$interfaces
protected
array<string|int, mixed>
$interfaces
$line
protected
int
$line
$text
protected
string
$text
$tokenStream
protected
PHP_Token_Stream
$tokenStream
Methods
__construct()
Constructor.
public
__construct(string $text, int $line, PHP_Token_Stream $tokenStream, int $id) : mixed
Parameters
- $text : string
- $line : int
- $tokenStream : PHP_Token_Stream
- $id : int
Return values
mixed —__toString()
public
__toString() : string
Return values
string —getDocblock()
Get the docblock for this token
public
getDocblock() : string|null
This method will fetch the docblock belonging to the current token. The docblock must be placed on the line directly above the token to be recognized.
Return values
string|null —Returns the docblock as a string if found
getEndLine()
public
getEndLine() : int
Return values
int —getEndTokenId()
public
getEndTokenId() : int
Return values
int —getInterfaces()
public
getInterfaces() : array<string|int, mixed>|bool
Return values
array<string|int, mixed>|bool —getKeywords()
public
getKeywords() : string
Return values
string —getLine()
public
getLine() : int
Return values
int —getName()
public
getName() : string
Return values
string —getPackage()
public
getPackage() : array<string|int, mixed>
Return values
array<string|int, mixed> —getParent()
public
getParent() : bool|string
Return values
bool|string —getVisibility()
public
getVisibility() : string
Return values
string —hasInterfaces()
public
hasInterfaces() : bool
Return values
bool —hasParent()
public
hasParent() : bool
Return values
bool —arrayToName()
protected
arrayToName(array<string|int, mixed> $parts[, string $join = '\' ]) : string
Parameters
- $parts : array<string|int, mixed>
- $join : string = '\'