PHP Class Eloquent\Phony\Hook\FunctionHookManager

Datei anzeigen Open project: eloquent/phony Class Usage Examples

Public Properties

Property Type Description
$hooks

Public Methods

Method Description
__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.

Method Details

__construct() public method

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() public method

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.
return callback | null The replaced callback, or null if no callback was set.

instance() public static method

Get the static instance of this manager.
public static instance ( ) : FunctionHookManager
return FunctionHookManager The static manager.

restoreGlobalFunctions() public method

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

Property Details

$hooks public_oe static_oe property

public static $hooks