VariableEnumerator
extends Enumerator
in package
Variable Enumerator class.
Table of Contents
- IS_CLASS = 'class'
- IS_CONSTANT = 'const'
- IS_FUNCTION = 'function'
- IS_GLOBAL = 'global'
- IS_PRIVATE = 'private'
- IS_PROTECTED = 'protected'
- IS_PUBLIC = 'public'
- $context : mixed
- $filter : mixed
- $presenter : mixed
- $specialNames : mixed
- __construct() : mixed
- Variable Enumerator constructor.
- enumerate() : array<string|int, mixed>
- Return a list of categorized things with the given input options and target.
- getVariables() : array<string|int, mixed>
- Get scope variables.
- listItems() : array<string|int, mixed>
- Enumerate specific items with the given input options and target.
- prepareVariables() : array<string|int, mixed>
- Prepare formatted variable array.
- presentRef() : mixed
- presentSignature() : mixed
- showItem() : mixed
Constants
IS_CLASS
public
mixed
IS_CLASS
= 'class'
IS_CONSTANT
public
mixed
IS_CONSTANT
= 'const'
IS_FUNCTION
public
mixed
IS_FUNCTION
= 'function'
IS_GLOBAL
public
mixed
IS_GLOBAL
= 'global'
IS_PRIVATE
public
mixed
IS_PRIVATE
= 'private'
IS_PROTECTED
public
mixed
IS_PROTECTED
= 'protected'
IS_PUBLIC
public
mixed
IS_PUBLIC
= 'public'
Properties
$context
private
mixed
$context
$filter
private
mixed
$filter
$presenter
private
mixed
$presenter
$specialNames
private
static mixed
$specialNames
= ['_', '_e', '__out', '__function', '__method', '__class', '__namespace', '__file', '__line', '__dir']
Methods
__construct()
Variable Enumerator constructor.
public
__construct(Presenter $presenter, Context $context) : mixed
Unlike most other enumerators, the Variable Enumerator needs access to the current scope variables, so we need to pass it a Context instance.
Parameters
Return values
mixed —enumerate()
Return a list of categorized things with the given input options and target.
public
enumerate(InputInterface $input[, Reflector $reflector = null ][, mixed $target = null ]) : array<string|int, mixed>
Parameters
- $input : InputInterface
- $reflector : Reflector = null
- $target : mixed = null
Return values
array<string|int, mixed> —getVariables()
Get scope variables.
protected
getVariables(bool $showAll) : array<string|int, mixed>
Parameters
- $showAll : bool
-
Include special variables (e.g. $_)
Return values
array<string|int, mixed> —listItems()
Enumerate specific items with the given input options and target.
protected
listItems(InputInterface $input[, Reflector $reflector = null ][, mixed $target = null ]) : array<string|int, mixed>
Parameters
- $input : InputInterface
- $reflector : Reflector = null
- $target : mixed = null
Return values
array<string|int, mixed> —prepareVariables()
Prepare formatted variable array.
protected
prepareVariables(array<string|int, mixed> $variables) : array<string|int, mixed>
Parameters
- $variables : array<string|int, mixed>
Return values
array<string|int, mixed> —presentRef()
protected
presentRef(mixed $value) : mixed
Parameters
- $value : mixed
Return values
mixed —presentSignature()
protected
presentSignature(mixed $target) : mixed
Parameters
- $target : mixed
Return values
mixed —showItem()
protected
showItem(mixed $name) : mixed
Parameters
- $name : mixed