PHP Класс Eloquent\Phony\Hook\FunctionHookManager

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

Открытые свойства

Свойство Тип Описание
$hooks

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

Метод Описание
__construct ( FunctionSignatureInspector $signatureInspector, FunctionHookGenerator $hookGenerator ) Construct a new function hook manager.
defineFunction ( string $name, string $namespace, callable $callback ) : callback | null Define the behavior of a function hook.
instance ( ) : FunctionHookManager Get the static instance of this manager.
restoreGlobalFunctions ( ) Effectively removes any function hooks for functions in the global namespace.

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

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

Construct a new function hook manager.
public __construct ( FunctionSignatureInspector $signatureInspector, FunctionHookGenerator $hookGenerator )
$signatureInspector Eloquent\Phony\Reflection\FunctionSignatureInspector The function signature inspector to use.
$hookGenerator FunctionHookGenerator The function hook generator to use.

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

Define the behavior of a function hook.
public defineFunction ( string $name, string $namespace, callable $callback ) : callback | null
$name string The function name.
$namespace string The namespace.
$callback callable The callback.
Результат callback | null The replaced callback, or null if no callback was set.

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

Get the static instance of this manager.
public static instance ( ) : FunctionHookManager
Результат FunctionHookManager The static manager.

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

Effectively removes any function hooks for functions in the global namespace.

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

$hooks публичное статическое свойство

public static $hooks