Context
class Context (View source)
A Eel evaluation context
It works as a variable container with wrapping of return values for safe access without warnings (on missing properties).
Methods
No description
Get a value by path and wrap it into another context
Call a method on this context
Call a method and wrap the result
Unwrap the context value recursively
Unwrap a value by unwrapping nested context objects
Details
__construct(mixed $value = null, EelInvocationTracerInterface|null $tracer = null)
No description
mixed
get(string|int|Context $path)
Get a value of the context
This basically acts as a safe access to non-existing properties, unified array and property access (using getters) and access to the current value (empty path).
If a property or key did not exist this method will return NULL.
Context
getAndWrap(string $path = null)
Get a value by path and wrap it into another context
mixed
call(string $method, array $arguments = [])
Call a method on this context
mixed
callAndWrap(string $method, array $arguments = [])
Call a method and wrap the result
Context
wrap(mixed $value)
Wraps the given value in a new Context
mixed
unwrap()
Unwrap the context value recursively
mixed
unwrapValue(mixed $value)
Unwrap a value by unwrapping nested context objects
This method is public for closure access.
Context
push(mixed $value, string $key = null)
Push an entry to the context
Is used to build array instances inside the evaluator.