PHP Class PHPSA\Variable

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

Protected Properties

Свойство Type Description
$branch integer | string
$gets how many times was read from the var
$name variable name
$referenced is it referenced to another var?
$referencedTo to which variable referenced?
$sets how many times was written to the var
$type variable type
$value variable value

Méthodes publiques

Méthode Description
__construct ( string $name, mixed $defaultValue = null, integer $type = CompiledExpression::UNKNOWN, integer | string $branch = self::BRANCH_ROOT ) Creates a variable.
__debugInfo ( ) : array
dec ( ) Decrement value of the variable
getGets ( ) : integer Gets the read counter.
getName ( ) : string
getReferencedTo ( ) : null | Variable
getSets ( ) : integer Gets the write counter.
getSymbolType ( ) : string
getType ( ) : mixed
getTypeName ( ) : string
getValue ( ) : mixed
inc ( ) Increment value of the variable
incGets ( ) : integer Increases the read counter.
incSets ( ) : integer Increases the write counter.
incUse ( ) Increment uses for gets and sets
isNumeric ( ) : boolean Is it an integer,double or number.
isReferenced ( ) : boolean
isUnused ( ) : boolean Check if you are setting values to variable but didn't use it (means get)
modify ( integer $type, mixed $value ) Changes variable type and value.
modifyType ( integer $type ) Changes variable type.
setReferencedTo ( Variable $referencedTo = null )

Method Details

__construct() public méthode

Creates a variable.
public __construct ( string $name, mixed $defaultValue = null, integer $type = CompiledExpression::UNKNOWN, integer | string $branch = self::BRANCH_ROOT )
$name string
$defaultValue mixed
$type integer
$branch integer | string

__debugInfo() public méthode

public __debugInfo ( ) : array
Résultat array

dec() public méthode

Decrement value of the variable
public dec ( )

getGets() public méthode

Gets the read counter.
public getGets ( ) : integer
Résultat integer

getName() public méthode

public getName ( ) : string
Résultat string

getReferencedTo() public méthode

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

getSets() public méthode

Gets the write counter.
public getSets ( ) : integer
Résultat integer

getSymbolType() public méthode

public getSymbolType ( ) : string
Résultat string

getType() public méthode

public getType ( ) : mixed
Résultat mixed

getTypeName() public méthode

public getTypeName ( ) : string
Résultat string

getValue() public méthode

public getValue ( ) : mixed
Résultat mixed

inc() public méthode

Increment value of the variable
public inc ( )

incGets() public méthode

Increases the read counter.
public incGets ( ) : integer
Résultat integer

incSets() public méthode

Increases the write counter.
public incSets ( ) : integer
Résultat integer

incUse() public méthode

Increment uses for gets and sets
public incUse ( )

isNumeric() public méthode

Is it an integer,double or number.
public isNumeric ( ) : boolean
Résultat boolean

isReferenced() public méthode

public isReferenced ( ) : boolean
Résultat boolean

isUnused() public méthode

Check if you are setting values to variable but didn't use it (means get)
public isUnused ( ) : boolean
Résultat boolean

modify() public méthode

Changes variable type and value.
public modify ( integer $type, mixed $value )
$type integer
$value mixed

modifyType() public méthode

Changes variable type.
public modifyType ( integer $type )
$type integer

setReferencedTo() public méthode

public setReferencedTo ( Variable $referencedTo = null )
$referencedTo Variable

Property Details

$branch protected_oe property

protected int|string $branch
Résultat integer | string

$gets protected_oe property

how many times was read from the var
protected $gets

$name protected_oe property

variable name
protected $name

$referenced protected_oe property

is it referenced to another var?
protected $referenced

$referencedTo protected_oe property

to which variable referenced?
protected $referencedTo

$sets protected_oe property

how many times was written to the var
protected $sets

$type protected_oe property

variable type
protected $type

$value protected_oe property

variable value
protected $value