Overview

Namespaces

  • TokenReflection
    • Broker
      • Backend
    • Dummy
    • Exception
    • Invalid
    • Php
    • Stream

Classes

  • Broker
  • ReflectionAnnotation
  • ReflectionBase
  • ReflectionClass
  • ReflectionConstant
  • ReflectionElement
  • ReflectionFile
  • ReflectionFileNamespace
  • ReflectionFunction
  • ReflectionFunctionBase
  • ReflectionMethod
  • ReflectionNamespace
  • ReflectionParameter
  • ReflectionProperty
  • Resolver

Interfaces

  • IReflection
  • IReflectionClass
  • IReflectionConstant
  • IReflectionExtension
  • IReflectionFunction
  • IReflectionFunctionBase
  • IReflectionMethod
  • IReflectionNamespace
  • IReflectionParameter
  • IReflectionProperty
  • Overview
  • Namespace
  • Class
  • Tree
  • Download

Class ReflectionMethod

Tokenized class method reflection.

TokenReflection\ReflectionBase implements TokenReflection\IReflection
Extended by TokenReflection\ReflectionElement
Extended by TokenReflection\ReflectionFunctionBase implements TokenReflection\IReflectionFunctionBase
Extended by TokenReflection\ReflectionMethod implements TokenReflection\IReflectionMethod
Namespace: TokenReflection
Located at ReflectionMethod.php
Methods summary
public TokenReflection\ReflectionClass|null
# getDeclaringClass( )

Returns the declaring class reflection.

Returns the declaring class reflection.

Returns

TokenReflection\ReflectionClass|null

Implementation of

TokenReflection\IReflectionMethod::getDeclaringClass()
public string|null
# getDeclaringClassName( )

Returns the declaring class name.

Returns the declaring class name.

Returns

string|null

Implementation of

TokenReflection\IReflectionMethod::getDeclaringClassName()
public integer
# getModifiers( )

Returns method modifiers.

Returns method modifiers.

Returns

integer

Implementation of

TokenReflection\IReflectionMethod::getModifiers()
public boolean
# isAbstract( )

Returns if the method is abstract.

Returns if the method is abstract.

Returns

boolean

Implementation of

TokenReflection\IReflectionMethod::isAbstract()
public boolean
# isFinal( )

Returns if the method is final.

Returns if the method is final.

Returns

boolean

Implementation of

TokenReflection\IReflectionMethod::isFinal()
public boolean
# isPrivate( )

Returns if the method is private.

Returns if the method is private.

Returns

boolean

Implementation of

TokenReflection\IReflectionMethod::isPrivate()
public boolean
# isProtected( )

Returns if the method is protected.

Returns if the method is protected.

Returns

boolean

Implementation of

TokenReflection\IReflectionMethod::isProtected()
public boolean
# isPublic( )

Returns if the method is public.

Returns if the method is public.

Returns

boolean

Implementation of

TokenReflection\IReflectionMethod::isPublic()
public boolean
# isStatic( )

Returns if the method is static.

Returns if the method is static.

Returns

boolean

Implementation of

TokenReflection\IReflectionMethod::isStatic()
public boolean
# is( integer $filter = null )

Shortcut for isPublic(), ... methods that allows or-ed modifiers.

Shortcut for isPublic(), ... methods that allows or-ed modifiers.

The TokenReflection\ReflectionMethod::getModifiers() method is called only when really necessary making this a more efficient way of doing

if ($method->getModifiers() & $filter) {
   ...
}

Parameters

$filter
integer
$filter Filter

Returns

boolean

Implementation of

TokenReflection\IReflectionMethod::is()
public boolean
# isConstructor( )

Returns if the method is a constructor.

Returns if the method is a constructor.

Returns

boolean

Implementation of

TokenReflection\IReflectionMethod::isConstructor()
public boolean
# isDestructor( )

Returns if the method is a destructor.

Returns if the method is a destructor.

Returns

boolean

Implementation of

TokenReflection\IReflectionMethod::isDestructor()
public TokenReflection\ReflectionMethod
# getPrototype( )

Returns the method prototype.

Returns the method prototype.

Returns

TokenReflection\ReflectionMethod

Throws

TokenReflection\Exception\RuntimeException
If the method has no prototype.

Implementation of

TokenReflection\IReflectionMethod::getPrototype()
public string
# getPrettyName( )

Returns an element pretty (docblock compatible) name.

Returns an element pretty (docblock compatible) name.

Returns

string

Overrides

TokenReflection\ReflectionFunctionBase::getPrettyName()

Implementation of

TokenReflection\IReflection::getPrettyName()
public string
# __toString( )

Returns the string representation of the reflection object.

Returns the string representation of the reflection object.

Returns

string
public static string|null
# export( TokenReflection\Broker $broker, string|object $class, string $method, boolean $return = false )

Exports a reflected object.

Exports a reflected object.

Parameters

$broker
TokenReflection\Broker
$broker Broker instance
$class
string|object
$class Class name or class instance
$method
string
$method Method name
$return
boolean
$return Return the export instead of outputting it

Returns

string|null

Throws

TokenReflection\Exception\RuntimeException
If requested parameter doesn't exist.
public mixed
# invoke( object $object, mixed $args )

Calls the method on an given instance.

Calls the method on an given instance.

Parameters

$object
object
$object Class instance
$args
mixed
$args

Returns

mixed

Implementation of

TokenReflection\IReflectionMethod::invoke()
public mixed
# invokeArgs( object $object, array $args = array() )

Calls the method on an given object.

Calls the method on an given object.

Parameters

$object
object
$object Class instance
$args
array
$args Method parameter values

Returns

mixed

Throws

TokenReflection\Exception\RuntimeException
If it is not possible to invoke the method.

Implementation of

TokenReflection\IReflectionMethod::invokeArgs()
public boolean
# isAccessible( )

Returns if the property is set accessible.

Returns if the property is set accessible.

Returns

boolean
public
# setAccessible( boolean $accessible )

Sets a method to be accessible or not.

Sets a method to be accessible or not.

Parameters

$accessible
boolean
$accessible

Implementation of

TokenReflection\IReflectionMethod::setAccessible()
public array
# getNamespaceAliases( )

Returns imported namespaces and aliases from the declaring namespace.

Returns imported namespaces and aliases from the declaring namespace.

Returns

array
public Closure
# getClosure( object $object )

Returns the function/method as closure.

Returns the function/method as closure.

Parameters

$object
object
$object Object

Returns

Closure

Implementation of

TokenReflection\IReflectionMethod::getClosure()
public TokenReflection\ReflectionMethod
# alias( TokenReflection\ReflectionClass $parent, string $name = null, integer $accessLevel = null )

Creates a method alias of the given name and access level for the given class.

Creates a method alias of the given name and access level for the given class.

Parameters

$parent
TokenReflection\ReflectionClass
$parent New parent class
$name
string
$name New method name
$accessLevel
integer
$accessLevel New access level

Returns

TokenReflection\ReflectionMethod

Throws

TokenReflection\Exception\RuntimeException
If an invalid method access level was found.
public string|null
# getOriginalName( )

Returns the original name when importing from a trait.

Returns the original name when importing from a trait.

Returns

string|null

Implementation of

TokenReflection\IReflectionMethod::getOriginalName()
public TokenReflection\IReflectionMethod|null
# getOriginal( )

Returns the original method when importing from a trait.

Returns the original method when importing from a trait.

Returns

TokenReflection\IReflectionMethod|null

Implementation of

TokenReflection\IReflectionMethod::getOriginal()
public integer|null
# getOriginalModifiers( )

Returns the original modifiers value when importing from a trait.

Returns the original modifiers value when importing from a trait.

Returns

integer|null

Implementation of

TokenReflection\IReflectionMethod::getOriginalModifiers()
public TokenReflection\IReflectionClass|null
# getDeclaringTrait( )

Returns the defining trait.

Returns the defining trait.

Returns

TokenReflection\IReflectionClass|null

Implementation of

TokenReflection\IReflectionMethod::getDeclaringTrait()
public string|null
# getDeclaringTraitName( )

Returns the declaring trait name.

Returns the declaring trait name.

Returns

string|null

Implementation of

TokenReflection\IReflectionMethod::getDeclaringTraitName()
protected TokenReflection\ReflectionElement
# processParent( TokenReflection\IReflection $parent, TokenReflection\Stream\StreamBase $tokenStream )

Processes the parent reflection object.

Processes the parent reflection object.

Parameters

$parent
TokenReflection\IReflection
$parent Parent reflection object
$tokenStream
TokenReflection\Stream\StreamBase
$tokenStream Token substream

Returns

TokenReflection\ReflectionElement

Throws

TokenReflection\Exception\ParseException
If an invalid parent reflection object was provided.

Overrides

TokenReflection\ReflectionElement::processParent()
protected TokenReflection\ReflectionMethod
# parse( TokenReflection\Stream\StreamBase $tokenStream, TokenReflection\IReflection $parent )

Parses reflected element metadata from the token stream.

Parses reflected element metadata from the token stream.

Parameters

$tokenStream
TokenReflection\Stream\StreamBase
$tokenStream Token substream
$parent
TokenReflection\IReflection
$parent Parent reflection object

Returns

TokenReflection\ReflectionMethod

Throws

TokenReflection\Exception\Parse
If the class could not be parsed.
Methods inherited from TokenReflection\ReflectionFunctionBase
aliasParameters(), getClosureScopeClass(), getClosureThis(), getName(), getNamespaceName(), getNumberOfParameters(), getNumberOfRequiredParameters(), getParameter(), getParameters(), getShortName(), getStaticVariables(), inNamespace(), isClosure(), parseChildren(), parseName(), parseParameters(), parseReturnsReference(), parseStaticVariables(), returnsReference()
Methods inherited from TokenReflection\ReflectionElement
__construct(), getDocblockTemplates(), getEndLine(), getEndPosition(), getExtension(), getExtensionName(), getFileName(), getFileReflection(), getSource(), getStartLine(), getStartPosition(), parseDocComment(), parseStream()
Methods inherited from TokenReflection\ReflectionBase
__get(), __isset(), exists(), get(), getAnnotation(), getAnnotations(), getBroker(), getDocComment(), hasAnnotation(), isDeprecated(), isInternal(), isTokenized(), isUserDefined()
Constants summary
integer IS_IMPLEMENTED_ABSTRACT 0x08
#

An implemented abstract method.

An implemented abstract method.

See

http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/Zend/zend_compile.h?revision=306939&view=markup#l114 ZEND_ACC_IMPLICIT_PUBLIC
integer ACCESS_LEVEL_CHANGED 0x800
#

Access level of this method has changed from the original implementation.

Access level of this method has changed from the original implementation.

See

http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/Zend/zend_compile.h?revision=306939&view=markup#l134 ZEND_ACC_CHANGED
integer IS_CONSTRUCTOR 0x2000
#

Method is constructor.

Method is constructor.

Legacy constructors are not supported.

See

http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/Zend/zend_compile.h?revision=306939&view=markup#l138 ZEND_ACC_CTOR
integer IS_DESTRUCTOR 0x4000
#

Method is destructor.

Method is destructor.

See

http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/Zend/zend_compile.h?revision=306939&view=markup#l139 ZEND_ACC_DTOR
integer IS_CLONE 0x8000
#

Method is __clone().

Method is __clone().

See

http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/Zend/zend_compile.h?revision=306939&view=markup#l140 ZEND_ACC_CLONE
integer IS_ALLOWED_STATIC 0x10000
#

Method can be called statically (although not defined static).

Method can be called statically (although not defined static).

See

http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/Zend/zend_compile.h?revision=306939&view=markup#l143 ZEND_ACC_ALLOW_STATIC
Constants inherited from TokenReflection\ReflectionElement
DOCBLOCK_TEMPLATE_END, DOCBLOCK_TEMPLATE_START
Properties summary
protected integer $modifiers 0
#

Method modifiers.

Method modifiers.

Properties inherited from TokenReflection\ReflectionFunctionBase
$namespaceName, $parameters
Properties inherited from TokenReflection\ReflectionElement
$docblockTemplates, $startPosition
Properties inherited from TokenReflection\ReflectionBase
$docComment, $name
PHP Token Reflection API documentation generated by ApiGen 2.8.0