Documentation

MethodReflection extends ReflectionMethod
in package
implements ReflectionInterface

Table of Contents

Interfaces

ReflectionInterface

Constants

PROTOTYPE_AS_ARRAY  = 'prototype_as_array'
Constant use in @MethodReflection to display prototype as an array
PROTOTYPE_AS_STRING  = 'prototype_as_string'
Constant use in @MethodReflection to display prototype as a string

Methods

__toString()  : string
getBody()  : string
Get method body
getContents()  : string
Get method contents
getDeclaringClass()  : ClassReflection
Get reflection of declaring class
getDocBlock()  : DocBlockReflection|false
Retrieve method DocBlock reflection
getParameters()  : array<string|int, ParameterReflection>
Get all method parameter reflection objects
getPrototype()  : array<string|int, mixed>|string
Get method prototype
getStartLine()  : int
Get start line (position) of method
toString()  : string
extractMethodContents()  : string
Tokenize method string and return concatenated body
extractPrefixedWhitespace()  : string
Take current position and find any whitespace
isEndingBrace()  : bool
Test for ending brace
isValidFunction()  : bool
Test to see if current position is valid function or closure. Returns true if it's a function and NOT a closure

Constants

PROTOTYPE_AS_ARRAY

Constant use in @MethodReflection to display prototype as an array

public mixed PROTOTYPE_AS_ARRAY = 'prototype_as_array'

PROTOTYPE_AS_STRING

Constant use in @MethodReflection to display prototype as a string

public mixed PROTOTYPE_AS_STRING = 'prototype_as_string'

Methods

getBody()

Get method body

public getBody() : string
Return values
string

getContents()

Get method contents

public getContents([bool $includeDocBlock = true ]) : string
Parameters
$includeDocBlock : bool = true
Return values
string

getPrototype()

Get method prototype

public getPrototype([string $format = self::PROTOTYPE_AS_ARRAY ]) : array<string|int, mixed>|string
Parameters
$format : string = self::PROTOTYPE_AS_ARRAY
Return values
array<string|int, mixed>|string

getStartLine()

Get start line (position) of method

public getStartLine([bool $includeDocComment = false ]) : int
Parameters
$includeDocComment : bool = false
Return values
int

extractMethodContents()

Tokenize method string and return concatenated body

protected extractMethodContents([bool $bodyOnly = false ]) : string
Parameters
$bodyOnly : bool = false
Return values
string

extractPrefixedWhitespace()

Take current position and find any whitespace

protected extractPrefixedWhitespace(array<string|int, mixed> $haystack, int $position) : string
Parameters
$haystack : array<string|int, mixed>
$position : int
Return values
string

isEndingBrace()

Test for ending brace

protected isEndingBrace(array<string|int, mixed> $haystack, int $position) : bool
Parameters
$haystack : array<string|int, mixed>
$position : int
Return values
bool

isValidFunction()

Test to see if current position is valid function or closure. Returns true if it's a function and NOT a closure

protected isValidFunction(array<string|int, mixed> $haystack, int $position[, string $functionName = null ]) : bool
Parameters
$haystack : array<string|int, mixed>
$position : int
$functionName : string = null
Return values
bool

        
On this page

Search results