CallableObject
extends AbstractCallable
in package
Pop utils callable object class
Tags
Table of Contents
Constants
- CLOSURE = 'CLOSURE'
- CLOSURE_PARAMS = 'CLOSURE_PARAMS'
- CONSTRUCTOR_CALL = 'CONSTRUCTOR_CALL'
- CONSTRUCTOR_CALL_PARAMS = 'CONSTRUCTOR_CALL_PARAMS'
- FUNCTION = 'FUNCTION'
- Call type constants
- FUNCTION_PARAMS = 'FUNCTION_PARAMS'
- INSTANCE_CALL = 'INSTANCE_CALL'
- INSTANCE_CALL_PARAMS = 'INSTANCE_CALL_PARAMS'
- IS_CALLABLE = 'IS_CALLABLE'
- IS_CALLABLE_PARAMS = 'IS_CALLABLE_PARAMS'
- NEW_OBJECT = 'NEW_OBJECT'
- OBJECT = 'OBJECT'
- STATIC_CALL = 'STATIC_CALL'
- STATIC_CALL_PARAMS = 'STATIC_CALL_PARAMS'
Properties
- $callable : mixed
- Callable
- $callableType : string|null
- Callable type
- $class : string|null
- Callable class
- $constructorParams : array<string|int, mixed>
- Constructor parameters for instance calls
- $method : string|null
- Callable method
- $parameters : array<string|int, mixed>
- Parameters
- $wasCalled : bool
- Was called flag
Methods
- __construct() : mixed
- Constructor
- addNamedParameter() : AbstractCallable
- Add a parameter
- addParameter() : AbstractCallable
- Add a parameter
- addParameters() : AbstractCallable
- Add parameters
- call() : mixed
- Execute the callable
- getCallable() : mixed
- Get callable
- getCallableType() : string|null
- Get callable type
- getConstructorParam() : mixed
- Get a constructor parameter for instance call
- getConstructorParams() : array<string|int, mixed>
- Get constructor parameters for instance call
- getParameter() : mixed
- Get a parameter
- getParameters() : array<string|int, mixed>
- Get parameters
- hasConstructorParam() : bool
- Has a constructor parameter for instance call
- hasConstructorParams() : bool
- Has constructor parameters for instance call
- hasParameter() : bool
- Has a parameter
- hasParameters() : bool
- Has parameters
- isCallable() : bool
- Check if object is callable
- prepare() : CallableObject
- Prepare object for call
- prepareParameters() : CallableObject
- Prepare parameters
- removeConstructorParam() : AbstractCallable
- Remove a constructor parameter for instance call
- removeConstructorParams() : AbstractCallable
- Remove all constructor parameters for instance call
- removeParameter() : AbstractCallable
- Remove a parameter
- removeParameters() : AbstractCallable
- Remove all parameters
- setCallable() : AbstractCallable
- Set callable
- setConstructorParams() : AbstractCallable
- Set constructor parameters
- setParameters() : AbstractCallable
- Set parameters
- wasCalled() : bool
- Check if object was called
Constants
CLOSURE
public
mixed
CLOSURE
= 'CLOSURE'
CLOSURE_PARAMS
public
mixed
CLOSURE_PARAMS
= 'CLOSURE_PARAMS'
CONSTRUCTOR_CALL
public
mixed
CONSTRUCTOR_CALL
= 'CONSTRUCTOR_CALL'
CONSTRUCTOR_CALL_PARAMS
public
mixed
CONSTRUCTOR_CALL_PARAMS
= 'CONSTRUCTOR_CALL_PARAMS'
FUNCTION
Call type constants
public
mixed
FUNCTION
= 'FUNCTION'
FUNCTION_PARAMS
public
mixed
FUNCTION_PARAMS
= 'FUNCTION_PARAMS'
INSTANCE_CALL
public
mixed
INSTANCE_CALL
= 'INSTANCE_CALL'
INSTANCE_CALL_PARAMS
public
mixed
INSTANCE_CALL_PARAMS
= 'INSTANCE_CALL_PARAMS'
IS_CALLABLE
public
mixed
IS_CALLABLE
= 'IS_CALLABLE'
IS_CALLABLE_PARAMS
public
mixed
IS_CALLABLE_PARAMS
= 'IS_CALLABLE_PARAMS'
NEW_OBJECT
public
mixed
NEW_OBJECT
= 'NEW_OBJECT'
OBJECT
public
mixed
OBJECT
= 'OBJECT'
STATIC_CALL
public
mixed
STATIC_CALL
= 'STATIC_CALL'
STATIC_CALL_PARAMS
public
mixed
STATIC_CALL_PARAMS
= 'STATIC_CALL_PARAMS'
Properties
$callable
Callable
protected
mixed
$callable
= null
$callableType
Callable type
protected
string|null
$callableType
= null
$class
Callable class
protected
string|null
$class
= null
$constructorParams
Constructor parameters for instance calls
protected
array<string|int, mixed>
$constructorParams
= []
$method
Callable method
protected
string|null
$method
= null
$parameters
Parameters
protected
array<string|int, mixed>
$parameters
= []
$wasCalled
Was called flag
protected
bool
$wasCalled
= false
Methods
__construct()
Constructor
public
__construct(mixed $callable[, mixed $parameters = null ]) : mixed
Instantiate the callable object
Parameters
- $callable : mixed
- $parameters : mixed = null
addNamedParameter()
Add a parameter
public
addNamedParameter(string $name, mixed $parameter) : AbstractCallable
Parameters
- $name : string
- $parameter : mixed
Return values
AbstractCallableaddParameter()
Add a parameter
public
addParameter(mixed $parameter) : AbstractCallable
Parameters
- $parameter : mixed
Return values
AbstractCallableaddParameters()
Add parameters
public
addParameters(array<string|int, mixed> $parameters) : AbstractCallable
Parameters
- $parameters : array<string|int, mixed>
Return values
AbstractCallablecall()
Execute the callable
public
call([mixed $parameters = null ]) : mixed
Parameters
- $parameters : mixed = null
Tags
getCallable()
Get callable
public
getCallable() : mixed
getCallableType()
Get callable type
public
getCallableType() : string|null
Return values
string|nullgetConstructorParam()
Get a constructor parameter for instance call
public
getConstructorParam(string $key) : mixed
Parameters
- $key : string
getConstructorParams()
Get constructor parameters for instance call
public
getConstructorParams() : array<string|int, mixed>
Return values
array<string|int, mixed>getParameter()
Get a parameter
public
getParameter(string $key) : mixed
Parameters
- $key : string
getParameters()
Get parameters
public
getParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>hasConstructorParam()
Has a constructor parameter for instance call
public
hasConstructorParam(string $key) : bool
Parameters
- $key : string
Return values
boolhasConstructorParams()
Has constructor parameters for instance call
public
hasConstructorParams() : bool
Return values
boolhasParameter()
Has a parameter
public
hasParameter(string $key) : bool
Parameters
- $key : string
Return values
boolhasParameters()
Has parameters
public
hasParameters() : bool
Return values
boolisCallable()
Check if object is callable
public
isCallable() : bool
Return values
boolprepare()
Prepare object for call
public
prepare() : CallableObject
Tags
Return values
CallableObjectprepareParameters()
Prepare parameters
public
prepareParameters() : CallableObject
Tags
Return values
CallableObjectremoveConstructorParam()
Remove a constructor parameter for instance call
public
removeConstructorParam(string $key) : AbstractCallable
Parameters
- $key : string
Return values
AbstractCallableremoveConstructorParams()
Remove all constructor parameters for instance call
public
removeConstructorParams() : AbstractCallable
Return values
AbstractCallableremoveParameter()
Remove a parameter
public
removeParameter(string $key) : AbstractCallable
Parameters
- $key : string
Return values
AbstractCallableremoveParameters()
Remove all parameters
public
removeParameters() : AbstractCallable
Return values
AbstractCallablesetCallable()
Set callable
public
setCallable(mixed $callable) : AbstractCallable
Parameters
- $callable : mixed
Return values
AbstractCallablesetConstructorParams()
Set constructor parameters
public
setConstructorParams(array<string|int, mixed> $constructorParams) : AbstractCallable
Parameters
- $constructorParams : array<string|int, mixed>
Return values
AbstractCallablesetParameters()
Set parameters
public
setParameters(array<string|int, mixed> $parameters) : AbstractCallable
Parameters
- $parameters : array<string|int, mixed>
Return values
AbstractCallablewasCalled()
Check if object was called
public
wasCalled() : bool