PHP Класс Kahlan\Jit\Patcher\Monkey

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_blacklist array Ignoring the following statements which are not valid function or class names.
$_counter integer Counter for building unique variable name.
$_depth integer Nested function depth level.
$_prefix string Prefix to use for custom variable name.
$_regex string The regex.
$_uses array Uses for the parsed node's namespace.
$_variables array Variables for the parsed node.

Открытые методы

Метод Описание
__construct ( $config = [] ) The constructor.
blacklisted ( string $name = null ) : boolean Check if a function is part of the blacklisted ones.
findFile ( object $loader, string $class, string $file ) : string The JIT find file patcher.
patchable ( string $class ) : boolean The JIT patchable checker.
process ( object $node, string $path = null ) : object The JIT patcher.

Защищенные методы

Метод Описание
_addClosingParenthesis ( $pos, integer $index, array $parent ) : boolean Add a closing parenthesis
_flushVariables ( array $node ) Flush stored variables in the passed node.
_monkeyPatch ( object $node, array $parent, integer $index ) Monkey patch a node body.
_processTree ( $parent ) Helper for Monkey::process().

Описание методов

__construct() публичный Метод

The constructor.
public __construct ( $config = [] )

_addClosingParenthesis() защищенный Метод

Add a closing parenthesis
protected _addClosingParenthesis ( $pos, integer $index, array $parent ) : boolean
$index integer The index of node in parent children.
$parent array The parent array.
Результат boolean Returns `true` if succeed, `false` otherwise.

_flushVariables() защищенный Метод

Flush stored variables in the passed node.
protected _flushVariables ( array $node )
$node array The node to store variables in.

_monkeyPatch() защищенный Метод

Monkey patch a node body.
protected _monkeyPatch ( object $node, array $parent, integer $index )
$node object The node to monkey patch.
$parent array The parent array.
$index integer The index of node in parent children.

_processTree() защищенный Метод

Helper for Monkey::process().
protected _processTree ( $parent )

blacklisted() публичный статический Метод

Check if a function is part of the blacklisted ones.
public static blacklisted ( string $name = null ) : boolean
$name string A function name.
Результат boolean

findFile() публичный Метод

The JIT find file patcher.
public findFile ( object $loader, string $class, string $file ) : string
$loader object The autloader instance.
$class string The fully-namespaced class name.
$file string The correponding finded file path.
Результат string The patched file path.

patchable() публичный Метод

The JIT patchable checker.
public patchable ( string $class ) : boolean
$class string The fully-namespaced class name to check.
Результат boolean

process() публичный Метод

The JIT patcher.
public process ( object $node, string $path = null ) : object
$node object The node instance to patch.
$path string The file path of the source code.
Результат object The patched node.

Описание свойств

$_blacklist защищенное статическое свойство

Ignoring the following statements which are not valid function or class names.
protected static array $_blacklist
Результат array

$_counter защищенное свойство

Counter for building unique variable name.
protected int $_counter
Результат integer

$_depth защищенное свойство

Nested function depth level.
protected int $_depth
Результат integer

$_prefix защищенное свойство

Prefix to use for custom variable name.
protected string $_prefix
Результат string

$_regex защищенное свойство

The regex.
protected string $_regex
Результат string

$_uses защищенное свойство

Uses for the parsed node's namespace.
protected array $_uses
Результат array

$_variables защищенное свойство

Variables for the parsed node.
protected array $_variables
Результат array