PHP Class Neos\Eel\Context

It works as a variable container with wrapping of return values for safe access without warnings (on missing properties).
Mostrar archivo Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$value mixed

Public Methods

Method Description
__construct ( mixed $value = null )
__toString ( ) : string
call ( string $method, array $arguments = [] ) : mixed Call a method on this context
callAndWrap ( string $method, array $arguments = [] ) : mixed Call a method and wrap the result
get ( string | integer | Context $path ) : mixed Get a value of the context
getAndWrap ( string $path = null ) : Context Get a value by path and wrap it into another context
push ( mixed $value, string $key = null ) : Context Push an entry to the context
unwrap ( ) : mixed Unwrap the context value recursively
unwrapValue ( $value ) : mixed Unwrap a value by unwrapping nested context objects
wrap ( mixed $value ) : Context Wraps the given value in a new Context

Method Details

__construct() public method

public __construct ( mixed $value = null )
$value mixed

__toString() public method

public __toString ( ) : string
return string

call() public method

Call a method on this context
public call ( string $method, array $arguments = [] ) : mixed
$method string
$arguments array Arguments to the method, if of type Context they will be unwrapped
return mixed

callAndWrap() public method

Call a method and wrap the result
public callAndWrap ( string $method, array $arguments = [] ) : mixed
$method string
$arguments array
return mixed

get() public method

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.
public get ( string | integer | Context $path ) : mixed
$path string | integer | Context The path as string or Context value, will be unwrapped for convenience
return mixed The value

getAndWrap() public method

Get a value by path and wrap it into another context
public getAndWrap ( string $path = null ) : Context
$path string
return Context The wrapped value

push() public method

Is used to build array instances inside the evaluator.
public push ( mixed $value, string $key = null ) : Context
$value mixed
$key string
return Context

unwrap() public method

Unwrap the context value recursively
public unwrap ( ) : mixed
return mixed

unwrapValue() public method

This method is public for closure access.
public unwrapValue ( $value ) : mixed
$value
return mixed

wrap() public method

Wraps the given value in a new Context
public wrap ( mixed $value ) : Context
$value mixed
return Context

Property Details

$value protected_oe property

protected mixed $value
return mixed