Psr2 Code Generator

ValuePart

Value part.

For all models that have a value (or expression)

Tags
author

Thomas Gossmann

Table of Contents

$expression  : string
$hasExpression  : bool
$hasValue  : bool
$value  : mixed
getExpression()  : string
Returns the expression.
getValue()  : null|bool|float|int|PhpConstant|string
Returns the value.
hasValue()  : bool
Checks whether a value or expression is set.
isExpression()  : bool
Returns whether an expression is set.
setExpression()  : $this
Sets an expression.
setValue()  : $this
Sets the value.
unsetExpression()  : $this
Unsets the expression.
unsetValue()  : $this
Unsets the value.
isPrimitive()  : bool
Returns whether the given value is a primitive.

Properties

$hasExpression

private bool $hasExpression = false

Methods

getExpression()

Returns the expression.

public getExpression() : string
Return values
string

hasValue()

Checks whether a value or expression is set.

public hasValue() : bool
Return values
bool

isExpression()

Returns whether an expression is set.

public isExpression() : bool
Return values
bool

setExpression()

Sets an expression.

public setExpression(string $expr) : $this
Parameters
$expr : string
Return values
$this

setValue()

Sets the value.

public setValue(mixed $value) : $this
Parameters
$value : mixed
Tags
throws
InvalidArgumentException

if the value is not an accepted primitve

Return values
$this

unsetExpression()

Unsets the expression.

public unsetExpression() : $this
Return values
$this

unsetValue()

Unsets the value.

public unsetValue() : $this
Return values
$this

isPrimitive()

Returns whether the given value is a primitive.

private isPrimitive(mixed $value) : bool
Parameters
$value : mixed
Return values
bool

Search results