PHP Interface gossi\codegen\model\ConstantsInterface

Implementation is realized in the ConstantsPart
Author: Thomas Gossmann
Datei anzeigen Open project: gossi/php-code-generator Interface Usage Examples

Public Methods

Method Description
clearConstants ( ) Clears all constants
getConstant ( string | PhpConstant $nameOrConstant ) : PhpConstant Returns a constant
getConstantNames ( ) : string[] Returns all constant names
getConstants ( ) : PhpConstant[] Returns constants
hasConstant ( string | PhpConstant $nameOrConstant ) : boolean Checks whether a constant exists
removeConstant ( string | PhpConstant $nameOrConstant ) Removes a constant
setConstant ( string | PhpConstant $nameOrConstant, string $value = null ) Adds a constant
setConstants ( array $constants ) Sets a collection of constants

Method Details

clearConstants() public method

Clears all constants
public clearConstants ( )

getConstant() public method

Returns a constant
public getConstant ( string | PhpConstant $nameOrConstant ) : PhpConstant
$nameOrConstant string | PhpConstant constant or name
return PhpConstant

getConstantNames() public method

Returns all constant names
public getConstantNames ( ) : string[]
return string[]

getConstants() public method

Returns constants
public getConstants ( ) : PhpConstant[]
return PhpConstant[]

hasConstant() public method

Checks whether a constant exists
public hasConstant ( string | PhpConstant $nameOrConstant ) : boolean
$nameOrConstant string | PhpConstant
return boolean

removeConstant() public method

Removes a constant
public removeConstant ( string | PhpConstant $nameOrConstant )
$nameOrConstant string | PhpConstant $nameOrConstant constant or name

setConstant() public method

Adds a constant
public setConstant ( string | PhpConstant $nameOrConstant, string $value = null )
$nameOrConstant string | PhpConstant constant or name
$value string

setConstants() public method

Sets a collection of constants
public setConstants ( array $constants )
$constants array