PHP Класс PHPSA\CompiledExpression

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$type integer By default we don't know what it is
$value mixed Possible value
$variable Variable | null

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

Метод Описание
__construct ( integer $type = self::UNKNOWN, mixed $value = null, Variable $variable = null ) Construct new CompiledExpression to pass result
__debugInfo ( ) : array Returns debug info.
canBeObject ( ) : boolean This is needed via in feature $this->type can store multiple type(s) by bitmask
fromZvalValue ( $value ) : CompiledExpression If we don't know $type but know $value
getType ( ) : integer Returns the type of the expression.
getTypeName ( ) : string Returns the type of the expression as a string.
getValue ( ) : mixed Returns the value of the expression.
getVariable ( ) : Variable | null
hasValue ( ) : boolean
isArray ( ) : boolean
isCallable ( ) : boolean
isCorrectValue ( ) : boolean Check that $this->value is correct for $this->type
isEquals ( integer $value ) : boolean Checks whether the expressions value equals the given value.
isObject ( ) : boolean
isScalar ( ) : boolean
isString ( ) : boolean
isTypeKnown ( ) : boolean
toVariable ( string $name ) : Variable Creates a variable from the expression.

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

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

Construct new CompiledExpression to pass result
public __construct ( integer $type = self::UNKNOWN, mixed $value = null, Variable $variable = null )
$type integer
$value mixed
$variable Variable

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

Returns debug info.
public __debugInfo ( ) : array
Результат array

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

This is needed via in feature $this->type can store multiple type(s) by bitmask
public canBeObject ( ) : boolean
Результат boolean

fromZvalValue() публичный статический Метод

If we don't know $type but know $value
public static fromZvalValue ( $value ) : CompiledExpression
$value
Результат CompiledExpression

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

Returns the type of the expression.
public getType ( ) : integer
Результат integer

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

Returns the type of the expression as a string.
public getTypeName ( ) : string
Результат string

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

Returns the value of the expression.
public getValue ( ) : mixed
Результат mixed

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

public getVariable ( ) : Variable | null
Результат Variable | null

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

public hasValue ( ) : boolean
Результат boolean

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

public isArray ( ) : boolean
Результат boolean

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

public isCallable ( ) : boolean
Результат boolean

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

Check that $this->value is correct for $this->type
public isCorrectValue ( ) : boolean
Результат boolean

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

Checks whether the expressions value equals the given value.
public isEquals ( integer $value ) : boolean
$value integer
Результат boolean

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

public isObject ( ) : boolean
Результат boolean

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

public isScalar ( ) : boolean
Результат boolean

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

public isString ( ) : boolean
Результат boolean

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

public isTypeKnown ( ) : boolean
Результат boolean

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

Creates a variable from the expression.
public toVariable ( string $name ) : Variable
$name string Name of the Variable
Результат Variable

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

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

By default we don't know what it is
protected int $type
Результат integer

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

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

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

protected Variable,phpsa|null $variable
Результат Variable | null