FileAccess Orion

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

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
throws
RuntimeException
throws
Exception
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
throws
RuntimeException

if invalid cached data

throws
Exception
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
throws
RuntimeException
throws
InvalidArgumentException
Return values
string

generateArgumentsKey()

Generate a unique key of the argument part.

protected generateArgumentsKey(array<string|int, mixed> $args) : string
Parameters
$args : array<string|int, mixed>
Tags
throws
RuntimeException
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

Tags
throws
RuntimeException

if callback not serializable

throws
InvalidArgumentException

if invalid callback

Return values
string

Search results