class PhpProperty extends AbstractPhpMember implements ValueInterface

Represents a PHP property.

Traits

Type docblock generator part
Value part
Docblock Part
Long description part
Name part
Type part

Constants

VISIBILITY_PRIVATE

Private visibility

VISIBILITY_PROTECTED

Protected visibility

VISIBILITY_PUBLIC

Public visibility

Methods

string
getDescription()

Returns this description

$this
setDescription(string|array $description)

Sets the description, which will also be used when generating a docblock

$this
setDocblock(Docblock|string $doc)

Sets the docblock

Docblock
getDocblock()

Returns the docblock

string
getLongDescription()

Returns the long description

$this
setLongDescription(string $longDescription)

Sets the long description

$this
setName(string $name)

Sets the name

from NamePart
string
getName()

Returns the name

from NamePart
$this
setType(string $type, string $description = null)

Sets the type

from TypePart
$this
setTypeDescription(string $description)

Sets the description for the type

from TypePart
string
getType()

Returns the type

from TypePart
string
getTypeDescription()

Returns the type description

from TypePart
__construct(string $name)

Creates a new member

$this
setVisibility(string $visibility)

Sets the members visibility

string
getVisibility()

Returns the visibility state of this member

$this
setStatic(bool $bool)

Sets whether or not this member is static

bool
isStatic()

Returns whether this member is static

$this
setParent(AbstractPhpStruct|null $parent)

Sets the parent structure to which this member belongs

getParent()

Returns the parent structure to which this member belongs

$this
setDefaultValue(mixed $value) deprecated

No description

from ValuePart
$this
unsetDefaultValue() deprecated

No description

from ValuePart
mixed
getDefaultValue() deprecated

No description

from ValuePart
bool
hasDefaultValue() deprecated

No description

from ValuePart
$this
setValue(string|integer|float|bool|null|PhpConstant $value)

Sets the value

from ValuePart
$this
unsetValue()

Unsets the value

from ValuePart
string|integer|float|bool|null|PhpConstant
getValue()

Returns the value

from ValuePart
bool
hasValue()

Checks whether a value or expression is set

from ValuePart
bool
isExpression()

Returns whether an expression is set

from ValuePart
$this
setExpression(string $expr)

Sets an expression

from ValuePart
string
getExpression()

Returns the expression

from ValuePart
$this
unsetExpression()

Unsets the expression

from ValuePart
static PhpProperty
create(string $name)

Creates a new PHP property

$this
generateDocblock()

Generates docblock based on provided information

Details

in AbstractModel at line line 19
string getDescription()

Returns this description

Return Value

string

in AbstractModel at line line 29
$this setDescription(string|array $description)

Sets the description, which will also be used when generating a docblock

Parameters

string|array $description

Return Value

$this

in DocblockPart at line line 24
$this setDocblock(Docblock|string $doc)

Sets the docblock

Parameters

Docblock|string $doc

Return Value

$this

in DocblockPart at line line 39
Docblock getDocblock()

Returns the docblock

Return Value

Docblock

in LongDescriptionPart at line line 21
string getLongDescription()

Returns the long description

Return Value

string

in LongDescriptionPart at line line 31
$this setLongDescription(string $longDescription)

Sets the long description

Parameters

string $longDescription

Return Value

$this

in NamePart at line line 22
$this setName(string $name)

Sets the name

Parameters

string $name

Return Value

$this

in NamePart at line line 33
string getName()

Returns the name

Return Value

string

in TypePart at line line 26
$this setType(string $type, string $description = null)

Sets the type

Parameters

string $type
string $description

Return Value

$this

in TypePart at line line 41
$this setTypeDescription(string $description)

Sets the description for the type

Parameters

string $description

Return Value

$this

in TypePart at line line 51
string getType()

Returns the type

Return Value

string

in TypePart at line line 60
string getTypeDescription()

Returns the type description

Return Value

string

in AbstractPhpMember at line line 73
__construct(string $name)

Creates a new member

Parameters

string $name the name of the member

in AbstractPhpMember at line line 87
$this setVisibility(string $visibility)

Sets the members visibility

Parameters

string $visibility the new visibility

Return Value

$this

See also

self::VISIBILITY_PUBLIC
self::VISIBILITY_PROTECTED
self::VISIBILITY_PRIVATE

in AbstractPhpMember at line line 104
string getVisibility()

Returns the visibility state of this member

Return Value

string the visibility

in AbstractPhpMember at line line 114
$this setStatic(bool $bool)

Sets whether or not this member is static

Parameters

bool $bool

Return Value

$this

in AbstractPhpMember at line line 125
bool isStatic()

Returns whether this member is static

Return Value

bool true if static and false if not

in AbstractPhpMember at line line 136
$this setParent(AbstractPhpStruct|null $parent)

Sets the parent structure to which this member belongs

Parameters

AbstractPhpStruct|null $parent

Return Value

$this

in AbstractPhpMember at line line 147
AbstractPhpStruct getParent()

Returns the parent structure to which this member belongs

Return Value

AbstractPhpStruct

in ValuePart at line line 32
$this setDefaultValue(mixed $value) deprecated

deprecated use `setValue()` instead

Parameters

mixed $value

Return Value

$this

in ValuePart at line line 40
$this unsetDefaultValue() deprecated

deprecated use `unsetValue()` instead

Return Value

$this

in ValuePart at line line 48
mixed getDefaultValue() deprecated

deprecated use `getValue()` instead

Return Value

mixed

in ValuePart at line line 56
bool hasDefaultValue() deprecated

deprecated use `hasValue()` instead

Return Value

bool

in ValuePart at line line 82
$this setValue(string|integer|float|bool|null|PhpConstant $value)

Sets the value

Parameters

string|integer|float|bool|null|PhpConstant $value

Return Value

$this

Exceptions

InvalidArgumentException if the value is not an accepted primitve

in ValuePart at line line 97
$this unsetValue()

Unsets the value

Return Value

$this

in ValuePart at line line 109
string|integer|float|bool|null|PhpConstant getValue()

Returns the value

Return Value

string|integer|float|bool|null|PhpConstant

in ValuePart at line line 118
bool hasValue()

Checks whether a value or expression is set

Return Value

bool

in ValuePart at line line 127
bool isExpression()

Returns whether an expression is set

Return Value

bool

in ValuePart at line line 137
$this setExpression(string $expr)

Sets an expression

Parameters

string $expr

Return Value

$this

in ValuePart at line line 149
string getExpression()

Returns the expression

Return Value

string

in ValuePart at line line 158
$this unsetExpression()

Unsets the expression

Return Value

$this

at line line 41
static PhpProperty create(string $name)

Creates a new PHP property

Parameters

string $name the properties name

Return Value

PhpProperty

at line line 48
$this generateDocblock()

Generates docblock based on provided information

Return Value

$this