PHP Class PHPSA\CompiledExpression

Afficher le fichier Open project: ovr/phpsa Class Usage Examples

Protected Properties

Свойство Type Description
$type integer By default we don't know what it is
$value mixed Possible value
$variable Variable | null

Méthodes publiques

Méthode Description
__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.

Method Details

__construct() public méthode

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() public méthode

Returns debug info.
public __debugInfo ( ) : array
Résultat array

canBeObject() public méthode

This is needed via in feature $this->type can store multiple type(s) by bitmask
public canBeObject ( ) : boolean
Résultat boolean

fromZvalValue() public static méthode

If we don't know $type but know $value
public static fromZvalValue ( $value ) : CompiledExpression
$value
Résultat CompiledExpression

getType() public méthode

Returns the type of the expression.
public getType ( ) : integer
Résultat integer

getTypeName() public méthode

Returns the type of the expression as a string.
public getTypeName ( ) : string
Résultat string

getValue() public méthode

Returns the value of the expression.
public getValue ( ) : mixed
Résultat mixed

getVariable() public méthode

public getVariable ( ) : Variable | null
Résultat Variable | null

hasValue() public méthode

public hasValue ( ) : boolean
Résultat boolean

isArray() public méthode

public isArray ( ) : boolean
Résultat boolean

isCallable() public méthode

public isCallable ( ) : boolean
Résultat boolean

isCorrectValue() public méthode

Check that $this->value is correct for $this->type
public isCorrectValue ( ) : boolean
Résultat boolean

isEquals() public méthode

Checks whether the expressions value equals the given value.
public isEquals ( integer $value ) : boolean
$value integer
Résultat boolean

isObject() public méthode

public isObject ( ) : boolean
Résultat boolean

isScalar() public méthode

public isScalar ( ) : boolean
Résultat boolean

isString() public méthode

public isString ( ) : boolean
Résultat boolean

isTypeKnown() public méthode

public isTypeKnown ( ) : boolean
Résultat boolean

toVariable() public méthode

Creates a variable from the expression.
public toVariable ( string $name ) : Variable
$name string Name of the Variable
Résultat Variable

Property Details

$type protected_oe property

By default we don't know what it is
protected int $type
Résultat integer

$value protected_oe property

Possible value
protected mixed $value
Résultat mixed

$variable protected_oe property

protected Variable,phpsa|null $variable
Résultat Variable | null