ConstantsInterface
Interface to all php structs that can have constants.
Implementation is realized in the ConstantsPart
Tags
Table of Contents
- clearConstants() : $this
- Clears all constants.
- getConstant() : PhpConstant
- Returns a constant.
- getConstantNames() : Set
- Returns all constant names.
- getConstants() : Map
- Returns constants.
- hasConstant() : bool
- Checks whether a constant exists.
- hasConstantByName() : bool
- Checks whether a constant exists.
- removeConstant() : $this
- Removes a constant.
- removeConstantByName() : $this
- Removes a constant passing its name.
- setConstant() : $this
- Adds a constant.
- setConstantByName() : $this
- Adds a constant passing its name.
- setConstants() : $this
- Sets a collection of constants.
Methods
clearConstants()
Clears all constants.
public
clearConstants() : $this
Return values
$this —getConstant()
Returns a constant.
public
getConstant(string $name) : PhpConstant
Parameters
- $name : string
Tags
Return values
PhpConstant —getConstantNames()
Returns all constant names.
public
getConstantNames() : Set
Return values
Set —getConstants()
Returns constants.
public
getConstants() : Map
Return values
Map —hasConstant()
Checks whether a constant exists.
public
hasConstant(PhpConstant $constant) : bool
Parameters
- $constant : PhpConstant
Return values
bool —hasConstantByName()
Checks whether a constant exists.
public
hasConstantByName(string $name) : bool
Parameters
- $name : string
Return values
bool —removeConstant()
Removes a constant.
public
removeConstant(PhpConstant $constant) : $this
Parameters
- $constant : PhpConstant
Tags
Return values
$this —removeConstantByName()
Removes a constant passing its name.
public
removeConstantByName(string $name) : $this
Parameters
- $name : string
-
constant name
Tags
Return values
$this —setConstant()
Adds a constant.
public
setConstant(PhpConstant $constant) : $this
Parameters
- $constant : PhpConstant
Return values
$this —setConstantByName()
Adds a constant passing its name.
public
setConstantByName(string $name[, string $value = null ]) : $this
Parameters
- $name : string
-
constant name
- $value : string = null
Return values
$this —setConstants()
Sets a collection of constants.
public
setConstants(array<string|int, mixed>|array<string|int, PhpConstant> $constants) : $this
Parameters
- $constants : array<string|int, mixed>|array<string|int, PhpConstant>