ExprBuilder
class ExprBuilder
This class builds an if expression.
Properties
protected | $node | ||
$ifPart | |||
$thenPart |
Methods
$this
ifString()
Tests if the value is a string.
$this
ifNull()
Tests if the value is null.
ifEmpty()
Tests if the value is empty.
$this
ifArray()
Tests if the value is an array.
$this
ifInArray(array $array)
Tests if the value is in an array.
$this
ifNotInArray(array $array)
Tests if the value is not in an array.
$this
castToArray()
Transforms variables of any type into an array.
$this
thenEmptyArray()
Sets a closure returning an empty array.
$this
thenInvalid(string $message)
Sets a closure marking the value as invalid at processing time.
$this
thenUnset()
Sets a closure unsetting this key of the array at processing time.
end()
Returns the related node.
static array
buildExpressions(array $expressions)
Builds the expressions.
Details
$this
ifTrue(Closure $closure = null)
Sets a closure to use as tests.
The default one tests if the value is true.