PhpConstant
class PhpConstant extends AbstractModel implements GenerateableInterface, DocblockInterface, ValueInterface
Represents a PHP constant.
Traits
Methods
Sets the description, which will also be used when generating a docblock
Sets the long description
Creates a new PHP constant
Creates a new PHP constant
No description
Details
in AbstractModel at line line 19
string
getDescription()
Returns this description
in AbstractModel at line line 29
$this
setDescription(string|array $description)
Sets the description, which will also be used when generating a docblock
in DocblockPart at line line 24
$this
setDocblock(Docblock|string $doc)
Sets the docblock
in DocblockPart at line line 39
Docblock
getDocblock()
Returns the docblock
in LongDescriptionPart at line line 21
string
getLongDescription()
Returns the long description
in LongDescriptionPart at line line 31
$this
setLongDescription(string $longDescription)
Sets the long description
in NamePart at line line 22
$this
setName(string $name)
Sets the name
in NamePart at line line 33
string
getName()
Returns the name
in TypePart at line line 51
string
getType()
Returns the type
in TypePart at line line 60
string
getTypeDescription()
Returns the type description
in TypePart at line line 26
$this
setType(string $type, string $description = null)
Sets the type
in TypePart at line line 41
$this
setTypeDescription(string $description)
Sets the description for the type
in ValuePart at line line 32
$this
setDefaultValue(mixed $value)
deprecated
deprecated
in ValuePart at line line 40
$this
unsetDefaultValue()
deprecated
deprecated
in ValuePart at line line 48
mixed
getDefaultValue()
deprecated
deprecated
in ValuePart at line line 56
bool
hasDefaultValue()
deprecated
deprecated
in ValuePart at line line 82
$this
setValue(string|integer|float|bool|null|PhpConstant $value)
Sets the value
in ValuePart at line line 97
$this
unsetValue()
Unsets the value
in ValuePart at line line 109
string|integer|float|bool|null|PhpConstant
getValue()
Returns the value
in ValuePart at line line 118
bool
hasValue()
Checks whether a value or expression is set
in ValuePart at line line 127
bool
isExpression()
Returns whether an expression is set
in ValuePart at line line 137
$this
setExpression(string $expr)
Sets an expression
in ValuePart at line line 149
string
getExpression()
Returns the expression
in ValuePart at line line 158
$this
unsetExpression()
Unsets the expression
at line line 35
static PhpConstant
create(string $name = null, mixed $value = null, bool $isExpression = false)
Creates a new PHP constant
at line line 46
__construct(string $name = null, mixed $value = null, bool $isExpression = false)
Creates a new PHP constant