Since: 7.0

final class ReflectionGenerator (View source)

The ReflectionGenerator class reports information about a generator.

Methods

__construct(Generator $generator)

Constructs a ReflectionGenerator object

int
getExecutingLine()

Gets the currently executing line of the generator

string
getExecutingFile()

Gets the file name of the currently executing generator

array
getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT)

Gets the trace of the executing generator

getFunction()

Gets the function name of the generator

object|null
getThis()

Gets the function name of the generator

getExecutingGenerator()

Gets the executing Generator object

bool
isClosed()

No description

Details

__construct(Generator $generator)

Since: 7.0

Constructs a ReflectionGenerator object

Parameters

Generator $generator

A generator object.

int getExecutingLine()

Since: 7.0

Gets the currently executing line of the generator

Return Value

int

Returns the line number of the currently executing statement in the generator.

string getExecutingFile()

Since: 7.0

Gets the file name of the currently executing generator

Return Value

string

Returns the full path and file name of the currently executing generator.

array getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT)

Since: 7.0

Gets the trace of the executing generator

Parameters

int $options

The value of options can be any of the following the following flags.

Available options:

{\DEBUG_BACKTRACE_PROVIDE_OBJECT} - Default

{\DEBUG_BACKTRACE_IGNORE_ARGS} - Don't include the argument information for functions in the stack trace.

Return Value

array

Returns the trace of the currently executing generator.

ReflectionFunctionAbstract getFunction()

Since: 7.0

Gets the function name of the generator

Return Value

ReflectionFunctionAbstract

Returns a {\ReflectionFunctionAbstract} class. This will be {\ReflectionFunction} for functions, or {\ReflectionMethod} for methods.

object|null getThis()

Since: 7.0

Gets the function name of the generator

Return Value

object|null

Returns the $this value, or {\null} if the generator was not created in a class context.

Generator getExecutingGenerator()

Since: 7.0

Gets the executing Generator object

Return Value

Generator

Returns the currently executing Generator object.

bool isClosed()

Since: 8.4

No description

Return Value

bool