CallbackCache
extends AbstractPattern
in package
Table of Contents
- $options : PatternOptions
- __call() : mixed
- function call handler
- call() : mixed
- Call the specified callback or get the result from cache
- generateKey() : string
- Generate a unique key in base of a key representing the callback part and a key representing the arguments part.
- getOptions() : PatternOptions
- Get all pattern options
- setOptions() : CallbackCache
- Set options
- generateArgumentsKey() : string
- Generate a unique key of the argument part.
- generateCallbackKey() : string
- Generate a unique key in base of a key representing the callback part and a key representing the arguments part.
Properties
$options
protected
PatternOptions
$options
Methods
__call()
function call handler
public
__call(string $function, array<string|int, mixed> $args) : mixed
Parameters
- $function : string
-
Function name to call
- $args : array<string|int, mixed>
-
Function arguments
Tags
Return values
mixed —call()
Call the specified callback or get the result from cache
public
call(callable $callback[, array<string|int, mixed> $args = [] ]) : mixed
Parameters
- $callback : callable
-
A valid callback
- $args : array<string|int, mixed> = []
-
Callback arguments
Tags
Return values
mixed —Result
generateKey()
Generate a unique key in base of a key representing the callback part and a key representing the arguments part.
public
generateKey(callable $callback[, array<string|int, mixed> $args = [] ]) : string
Parameters
- $callback : callable
-
A valid callback
- $args : array<string|int, mixed> = []
-
Callback arguments
Tags
Return values
string —getOptions()
Get all pattern options
public
getOptions() : PatternOptions
Return values
PatternOptions —setOptions()
Set options
public
setOptions(PatternOptions $options) : CallbackCache
Parameters
- $options : PatternOptions
Tags
Return values
CallbackCache —Provides a fluent interface
generateArgumentsKey()
Generate a unique key of the argument part.
protected
generateArgumentsKey(array<string|int, mixed> $args) : string
Parameters
- $args : array<string|int, mixed>
Tags
Return values
string —generateCallbackKey()
Generate a unique key in base of a key representing the callback part and a key representing the arguments part.
protected
generateCallbackKey(callable $callback, array<string|int, mixed> $args) : string
Parameters
- $callback : callable
-
A valid callback
- $args : array<string|int, mixed>
-
Callback arguments