Parses a method definition.

category phpDocumentor
package Reflection
author Mike van Riel
license MIT
link http://phpdoc.org

 Methods

Default behavior of the toString method is to return the name of this reflection.

__toString() : string
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::__toString()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::__toString()
inherited_from \phpDocumentor_Reflection_BracesAbstract::__toString()
inherited_from \phpDocumentor_Reflection_Function::__toString()

Returns

string

Dispatches a logging request to log a debug message.

debug(string $message) : void
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::debug()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::debug()
inherited_from \phpDocumentor_Reflection_BracesAbstract::debug()
inherited_from \phpDocumentor_Reflection_Function::debug()

Parameters

$message

string

The message to log.

Dispatches an event to the Event Dispatcher.

dispatch(string $name, \string[] $arguments) : mixed | null
Inherited

This method tries to dispatch an event; if no Event Dispatcher has been set than this method will explicitly not fail and return null. By not failing we make the Event Dispatcher optional and is it easier for people to re-use this component in their own application.

inherited_from \phpDocumentor_Reflection_Abstract::dispatch()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::dispatch()
inherited_from \phpDocumentor_Reflection_BracesAbstract::dispatch()
inherited_from \phpDocumentor_Reflection_Function::dispatch()

Parameters

$name

string

Name of the event to dispatch.

$arguments

\string[]

Arguments for this event.

Exceptions

\phpDocumentor_Parser_Exception if there is a dispatcher but it is not of type sfEventDispatcher

Returns

mixednull

Tries to expand a type to it's full namespaced equivalent.

expandType(string $type, bool $ignore_non_objects) : string
Inherited

inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::expandType()
inherited_from \phpDocumentor_Reflection_BracesAbstract::expandType()
inherited_from \phpDocumentor_Reflection_Function::expandType()

Parameters

$type

string

Type to expand into full namespaced equivalent.

$ignore_non_objects

bool

whether to ignore reserved words, when false it will not expand a set of keywords.

Returns

string

Returns the arguments for this element.

getArguments() : \phpDocumentor_Reflection_Argument[]
Inherited

inherited_from \phpDocumentor_Reflection_Function::getArguments()

Returns

Returns the name of the default package.

getDefaultPackageName() : string
Inherited

inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::getDefaultPackageName()
inherited_from \phpDocumentor_Reflection_BracesAbstract::getDefaultPackageName()
inherited_from \phpDocumentor_Reflection_Function::getDefaultPackageName()

Returns

string

Returns the DocBlock reflection object.

getDocBlock() : \phpDocumentor\Reflection\DocBlock | null
Inherited

inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::getDocBlock()
inherited_from \phpDocumentor_Reflection_BracesAbstract::getDocBlock()
inherited_from \phpDocumentor_Reflection_Function::getDocBlock()

Returns

Returns the token id which identifies the end of the object.

getEndTokenId() : int
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::getEndTokenId()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::getEndTokenId()
inherited_from \phpDocumentor_Reflection_BracesAbstract::getEndTokenId()
inherited_from \phpDocumentor_Reflection_Function::getEndTokenId()

Returns

int

Returns the name of the file to which this element is related.

getFilename() : string
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::getFilename()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::getFilename()
inherited_from \phpDocumentor_Reflection_BracesAbstract::getFilename()
inherited_from \phpDocumentor_Reflection_Function::getFilename()

Returns

string

Returns the line number where this token starts.

getLineNumber() : int
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::getLineNumber()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::getLineNumber()
inherited_from \phpDocumentor_Reflection_BracesAbstract::getLineNumber()
inherited_from \phpDocumentor_Reflection_Function::getLineNumber()

Returns

int

Returns the name for this Reflection object.

getName() : string
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::getName()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::getName()
inherited_from \phpDocumentor_Reflection_BracesAbstract::getName()
inherited_from \phpDocumentor_Reflection_Function::getName()

Returns

string

Returns the name of the namespace to which this belongs.

getNamespace() : string
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::getNamespace()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::getNamespace()
inherited_from \phpDocumentor_Reflection_BracesAbstract::getNamespace()
inherited_from \phpDocumentor_Reflection_Function::getNamespace()

Returns

string

Returns the namespace aliases which can be applied to the types in this object.

getNamespaceAliases() : \string[]
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::getNamespaceAliases()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::getNamespaceAliases()
inherited_from \phpDocumentor_Reflection_BracesAbstract::getNamespaceAliases()
inherited_from \phpDocumentor_Reflection_Function::getNamespaceAliases()

Returns

\string[]

Getter; returns the token id which identifies the start of this object.

getStartTokenId() : int
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::getStartTokenId()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::getStartTokenId()
inherited_from \phpDocumentor_Reflection_BracesAbstract::getStartTokenId()
inherited_from \phpDocumentor_Reflection_Function::getStartTokenId()

Returns

int

Returns whether this is a function or closure.

getType() : string
Inherited

inherited_from \phpDocumentor_Reflection_Function::getType()

Returns

string

Returns the visibility for this item.

getVisibility() : string

The returned value should match either of the following: * public * protected * private If a method has no visibility set in the class definition this method will return 'public'.

Returns

string

Returns whether this method is static.

isAbstract() : bool

Returns

bool

Returns whether this method is final.

isFinal() : bool

Returns

bool

Returns whether this method is static.

isStatic() : bool

Returns

bool

Dispatches a logging request.

log(string $message, int $priority) : void
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::log()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::log()
inherited_from \phpDocumentor_Reflection_BracesAbstract::log()
inherited_from \phpDocumentor_Reflection_Function::log()

Parameters

$message

string

The message to log.

$priority

int

The logging priority, the lower, the more important. Ranges from 1 to 7

Override method to add a validation point for the docblock where it has access to all processed tokens.

parseTokenizer(phpDocumentor_Reflection_TokenIterator $tokens) : void
Inherited

inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::parseTokenizer()
inherited_from \phpDocumentor_Reflection_BracesAbstract::parseTokenizer()
inherited_from \phpDocumentor_Reflection_Function::parseTokenizer()

Parameters

Generic method which iterates through all tokens between the braces following the current position in the token iterator.

processTokens(phpDocumentor_Reflection_TokenIterator $tokens) : \int[]
Inherited

Please note: This method will also move the cursor position in the token iterator forward. When a token is encountered this method will invoke the processToken method, which is defined in the * phpDocumentor_Reflection_Abstract class. Literals are ignored.

see \phpDocumentor_Reflection_Abstract
inherited_from \phpDocumentor_Reflection_BracesAbstract::processTokens()
inherited_from \phpDocumentor_Reflection_Function::processTokens()

Parameters

$tokens

\phpDocumentor_Reflection_TokenIterator

Tokens to interpret with the pointer at the token to be processed.

Returns

\int[]

Extracts the arguments from this function.

processVariable(phpDocumentor_Reflection_TokenIterator $tokens) : void
Inherited

inherited_from \phpDocumentor_Reflection_Function::processVariable()

Parameters

$tokens

\phpDocumentor_Reflection_TokenIterator

Tokens to interpret with the pointer at the token to be processed.

Sets the name of the Default package.

setDefaultPackageName(string $default_package_name) : void
Inherited

inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::setDefaultPackageName()
inherited_from \phpDocumentor_Reflection_BracesAbstract::setDefaultPackageName()
inherited_from \phpDocumentor_Reflection_Function::setDefaultPackageName()

Parameters

$default_package_name

string

The name that needs to be adopted by elements without package tags.

Sets the file name for this file.

setFilename(string $filename) : void
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::setFilename()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::setFilename()
inherited_from \phpDocumentor_Reflection_BracesAbstract::setFilename()
inherited_from \phpDocumentor_Reflection_Function::setFilename()

Parameters

$filename

string

The path of this file.

Sets the name for this Reflection Object.

setName(string $name) : void
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::setName()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::setName()
inherited_from \phpDocumentor_Reflection_BracesAbstract::setName()
inherited_from \phpDocumentor_Reflection_Function::setName()

Parameters

$name

string

String with unlimited length.

Exceptions

\InvalidArgumentException

Sets the name of the namespace to which this belongs.

setNamespace(string $namespace) : void
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::setNamespace()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::setNamespace()
inherited_from \phpDocumentor_Reflection_BracesAbstract::setNamespace()
inherited_from \phpDocumentor_Reflection_Function::setNamespace()

Parameters

$namespace

string

Full name of namespace.

Exceptions

\InvalidArgumentException

Sets the list of namespace aliases in the parent file..

setNamespaceAliases(\string[] $namespace_aliases) : void
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::setNamespaceAliases()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::setNamespaceAliases()
inherited_from \phpDocumentor_Reflection_BracesAbstract::setNamespaceAliases()
inherited_from \phpDocumentor_Reflection_Function::setNamespaceAliases()

Parameters

$namespace_aliases

\string[]

List of aliases to apply.

Exceptions

\InvalidArgumentException

Sets whether this is a function or closure.

setType(string $type) : void
Inherited

inherited_from \phpDocumentor_Reflection_Function::setType()

Parameters

$type

string

Must be either 'function' or 'closure'.

Determine whether this token has the abstract keyword.

findAbstract(phpDocumentor_Reflection_TokenIterator $tokens) : \phpDocumentor_Reflection_Token | null
Inherited

Please note that the iterator cursor does not change due to this method

inherited_from \phpDocumentor_Reflection_Abstract::findAbstract()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::findAbstract()
inherited_from \phpDocumentor_Reflection_BracesAbstract::findAbstract()
inherited_from \phpDocumentor_Reflection_Function::findAbstract()

Parameters

$tokens

\phpDocumentor_Reflection_TokenIterator

The iterator with tokens.

Returns

Find the Default value for this object.

findDefault(phpDocumentor_Reflection_TokenIterator $tokens) : string | null
Inherited

Usually used with variables or arguments. Please note that the iterator cursor does not change due to this method

inherited_from \phpDocumentor_Reflection_Abstract::findDefault()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::findDefault()
inherited_from \phpDocumentor_Reflection_BracesAbstract::findDefault()
inherited_from \phpDocumentor_Reflection_Function::findDefault()

Parameters

$tokens

\phpDocumentor_Reflection_TokenIterator

The iterator with tokens.

Returns

stringnull

Returns the first docblock preceding the active token within 10 tokens.

findDocBlock(phpDocumentor_Reflection_TokenIterator $tokens) : \phpDocumentor\Reflection\DocBlock | null
Inherited

Please note that the iterator cursor does not change with to this method.

inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::findDocBlock()
inherited_from \phpDocumentor_Reflection_BracesAbstract::findDocBlock()
inherited_from \phpDocumentor_Reflection_Function::findDocBlock()

Parameters

$tokens

\phpDocumentor_Reflection_TokenIterator

Tokens to process

Returns

Determine whether this token has the final keyword.

findFinal(phpDocumentor_Reflection_TokenIterator $tokens) : \phpDocumentor_Reflection_Token | null
Inherited

Please note that the iterator cursor does not change due to this method

inherited_from \phpDocumentor_Reflection_Abstract::findFinal()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::findFinal()
inherited_from \phpDocumentor_Reflection_BracesAbstract::findFinal()
inherited_from \phpDocumentor_Reflection_Function::findFinal()

Parameters

$tokens

\phpDocumentor_Reflection_TokenIterator

The iterator with tokens.

Returns

Finds the name of this function starting from the T_FUNCTION token.

findName(phpDocumentor_Reflection_TokenIterator $tokens) : string
Inherited

If a function has no name it is probably a Closure and will have the name Closure.

inherited_from \phpDocumentor_Reflection_Function::findName()

Parameters

$tokens

\phpDocumentor_Reflection_TokenIterator

Tokens to interpret with the pointer at the token to be processed.

Returns

string

Determine whether this token has the static keyword.

findStatic(phpDocumentor_Reflection_TokenIterator $tokens) : \phpDocumentor_Reflection_Token | null
Inherited

Please note that the iterator cursor does not change due to this method

inherited_from \phpDocumentor_Reflection_Abstract::findStatic()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::findStatic()
inherited_from \phpDocumentor_Reflection_BracesAbstract::findStatic()
inherited_from \phpDocumentor_Reflection_Function::findStatic()

Parameters

$tokens

\phpDocumentor_Reflection_TokenIterator

The iterator with tokens.

Returns

Find the Type for this object.

findType(phpDocumentor_Reflection_TokenIterator $tokens) : string | null
Inherited

Please note that the iterator cursor does not change due to this method

inherited_from \phpDocumentor_Reflection_Abstract::findType()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::findType()
inherited_from \phpDocumentor_Reflection_BracesAbstract::findType()
inherited_from \phpDocumentor_Reflection_Function::findType()

Parameters

$tokens

\phpDocumentor_Reflection_TokenIterator

The iterator with tokens.

Returns

stringnull

Searches for visibility specifiers with the current token.

findVisibility(phpDocumentor_Reflection_TokenIterator $tokens) : string
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::findVisibility()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::findVisibility()
inherited_from \phpDocumentor_Reflection_BracesAbstract::findVisibility()
inherited_from \phpDocumentor_Reflection_Function::findVisibility()

Parameters

$tokens

\phpDocumentor_Reflection_TokenIterator

Token iterator to search in.

Returns

stringpublic|private|protected

Helper method which merges a $document into $origin.

mergeDomDocuments(DOMDocument $origin, DOMDocument $document) : void
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::mergeDomDocuments()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::mergeDomDocuments()
inherited_from \phpDocumentor_Reflection_BracesAbstract::mergeDomDocuments()
inherited_from \phpDocumentor_Reflection_Function::mergeDomDocuments()

Parameters

$origin

\DOMDocument

The document to accept the changes.

$document

\DOMDocument

The changes which are to be merged into the origin.

Helper used to merge a given XML string into a given DOMDocument.

mergeXmlToDomDocument(DOMDocument $origin, string $xml) : void
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::mergeXmlToDomDocument()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::mergeXmlToDomDocument()
inherited_from \phpDocumentor_Reflection_BracesAbstract::mergeXmlToDomDocument()
inherited_from \phpDocumentor_Reflection_Function::mergeXmlToDomDocument()

Parameters

$origin

\DOMDocument

Destination to merge the XML into.

$xml

string

The XML to merge with the document.

Retrieves the generic information.

processGenericInformation(phpDocumentor_Reflection_TokenIterator $tokens) : void

Finds out whether this method is abstract, static, final and what visibility it has on top of the information found using the phpDocumentor_Reflection_Function parent method.

see \phpDocumentor_Reflection_Function::processGenericInformation

Parameters

$tokens

\phpDocumentor_Reflection_TokenIterator

Tokens to interpret with the pointer at the token to be processed.

Processes the current token and invokes the correct process* method.

processToken(phpDocumentor_Reflection_Token $token, phpDocumentor_Reflection_TokenIterator $tokens) : void
Inherited

Tokens are automatically parsed by invoking a process* method (i.e. processFunction for a T_FUNCTION). If a method, which conforms to the standard above, does not exist the token is ignored.

inherited_from \phpDocumentor_Reflection_Abstract::processToken()
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::processToken()
inherited_from \phpDocumentor_Reflection_BracesAbstract::processToken()
inherited_from \phpDocumentor_Reflection_Function::processToken()

Parameters

$token

\phpDocumentor_Reflection_Token

The specific token which needs processing.

$tokens

\phpDocumentor_Reflection_TokenIterator

The iterator with tokens.

 Properties

 

The event dispatcher object, may be null to not dispatch events.

$event_dispatcher : \sfEventDispatcher | null
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::$$event_dispatcher
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::$$event_dispatcher
inherited_from \phpDocumentor_Reflection_BracesAbstract::$$event_dispatcher
inherited_from \phpDocumentor_Reflection_Function::$$event_dispatcher
 

<p>Remembers whether this method is abstract</p>

$abstract : bool

 

<p>contains all arguments</p>

$arguments : \phpDocumentor_Reflection_Argument[]
Inherited

inherited_from \phpDocumentor_Reflection_Function::$$arguments
 

<p>Index of the last token in the argument list</p>

$arguments_token_end : int
Inherited

inherited_from \phpDocumentor_Reflection_Function::$$arguments_token_end
 

<p>Index of the first token in the argument list</p>

$arguments_token_start : int
Inherited

inherited_from \phpDocumentor_Reflection_Function::$$arguments_token_start
 

$default_package_name

$default_package_name 
Inherited

inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::$$default_package_name
inherited_from \phpDocumentor_Reflection_BracesAbstract::$$default_package_name
inherited_from \phpDocumentor_Reflection_Function::$$default_package_name
 

$doc_block

$doc_block : \phpDocumentor\Reflection\DocBlock | null
Inherited

inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::$$doc_block
inherited_from \phpDocumentor_Reflection_BracesAbstract::$$doc_block
inherited_from \phpDocumentor_Reflection_Function::$$doc_block
 

<p>The path of the file.</p>

$filename : string
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::$$filename
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::$$filename
inherited_from \phpDocumentor_Reflection_BracesAbstract::$$filename
inherited_from \phpDocumentor_Reflection_Function::$$filename
 

<p>Remembers whether this method is final</p>

$final : bool

 

Stores the line where the initial token was found.

$line_start : int
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::$$line_start
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::$$line_start
inherited_from \phpDocumentor_Reflection_BracesAbstract::$$line_start
inherited_from \phpDocumentor_Reflection_Function::$$line_start
 

Stores the name for this Reflection object.

$name : string
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::$$name
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::$$name
inherited_from \phpDocumentor_Reflection_BracesAbstract::$$name
inherited_from \phpDocumentor_Reflection_Function::$$name
 

Stores the name of the namespace to which this belongs.

$namespace : string
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::$$namespace
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::$$namespace
inherited_from \phpDocumentor_Reflection_BracesAbstract::$$namespace
inherited_from \phpDocumentor_Reflection_Function::$$namespace
 

Stores the aliases and full names of any defined namespace alias (T_USE).

$namespace_aliases : \string[]
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::$$namespace_aliases
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::$$namespace_aliases
inherited_from \phpDocumentor_Reflection_BracesAbstract::$$namespace_aliases
inherited_from \phpDocumentor_Reflection_Function::$$namespace_aliases
 

<p>Remembers whether this method is static</p>

$static : bool

 

Stores the end position by token index.

$token_end : int
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::$$token_end
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::$$token_end
inherited_from \phpDocumentor_Reflection_BracesAbstract::$$token_end
inherited_from \phpDocumentor_Reflection_Function::$$token_end
 

Stores the start position by token index.

$token_start : int
Inherited

inherited_from \phpDocumentor_Reflection_Abstract::$$token_start
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::$$token_start
inherited_from \phpDocumentor_Reflection_BracesAbstract::$$token_start
inherited_from \phpDocumentor_Reflection_Function::$$token_start
 

<p>Whether this is a 'function' or 'closure'</p>

$type : string
Inherited

inherited_from \phpDocumentor_Reflection_Function::$$type
 

<p>Remember the visibility of this method; may be either public, protected or private</p>

$visibility : string

 

Stores the method name of the processing method for a token.

$_token_method_cache : \string[]
Inherited

The generation of method names may be a performance costly task and is quite often executed. As such we cache the method names which are coming from tokens here in this array.

inherited_from \phpDocumentor_Reflection_Abstract::$$_token_method_cache
inherited_from \phpDocumentor_Reflection_DocBlockedAbstract::$$_token_method_cache
inherited_from \phpDocumentor_Reflection_BracesAbstract::$$_token_method_cache
inherited_from \phpDocumentor_Reflection_Function::$$_token_method_cache

 Constants

 

<p>identifier for the 'type' value of CLOSURE</p>

TYPE_CLOSURE : string
Inherited

inherited_from \phpDocumentor_Reflection_Function::TYPE_CLOSURE
 

<p>identifier for the 'type' value of FUNCTION</p>

TYPE_FUNCTION : string
Inherited

inherited_from \phpDocumentor_Reflection_Function::TYPE_FUNCTION