PHP Класс Neos\Eel\Context

It works as a variable container with wrapping of return values for safe access without warnings (on missing properties).
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$value mixed

Открытые методы

Метод Описание
__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

Описание методов

__construct() публичный Метод

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

__toString() публичный Метод

public __toString ( ) : string
Результат string

call() публичный Метод

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
Результат mixed

callAndWrap() публичный Метод

Call a method and wrap the result
public callAndWrap ( string $method, array $arguments = [] ) : mixed
$method string
$arguments array
Результат mixed

get() публичный Метод

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
Результат mixed The value

getAndWrap() публичный Метод

Get a value by path and wrap it into another context
public getAndWrap ( string $path = null ) : Context
$path string
Результат Context The wrapped value

push() публичный Метод

Is used to build array instances inside the evaluator.
public push ( mixed $value, string $key = null ) : Context
$value mixed
$key string
Результат Context

unwrap() публичный Метод

Unwrap the context value recursively
public unwrap ( ) : mixed
Результат mixed

unwrapValue() публичный Метод

This method is public for closure access.
public unwrapValue ( $value ) : mixed
$value
Результат mixed

wrap() публичный Метод

Wraps the given value in a new Context
public wrap ( mixed $value ) : Context
$value mixed
Результат Context

Описание свойств

$value защищенное свойство

protected mixed $value
Результат mixed