class PhpParameter extends AbstractModel implements ValueInterface

Represents a PHP parameter.

Traits

Name part
Type part
Value part

Methods

string
getDescription()

Returns this description

$this
setDescription(string|array $description)

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

$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)

Alias for setDescription()

string
getType()

Returns the type

from TypePart
string
getTypeDescription()

Alias for getDescription()

$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 PhpParameter
create(string $name = null)

Creates a new PHP parameter.

static PhpParameter
fromReflection(ReflectionParameter $ref) deprecated

Creates a PHP parameter from reflection

__construct(string $name = null)

Creates a new PHP parameter

$this
setPassedByReference(bool $bool)

Sets whether this parameter is passed by reference

bool
isPassedByReference()

Returns whether this parameter is passed by reference

ParamTag
getDocblockTag()

Returns a docblock tag for this parameter

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 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

at line line 150
$this setTypeDescription(string $description)

Alias for setDescription()

Parameters

string $description

Return Value

$this

See also

#setDescription

in TypePart at line line 51
string getType()

Returns the type

Return Value

string

at line line 160
string getTypeDescription()

Alias for getDescription()

Return Value

string

See also

#getDescription

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 45
static PhpParameter create(string $name = null)

Creates a new PHP parameter.

Parameters

string $name the parameter name

Return Value

PhpParameter

at line line 56
static PhpParameter fromReflection(ReflectionParameter $ref) deprecated

deprecated will be removed in version 0.5

Creates a PHP parameter from reflection

Parameters

ReflectionParameter $ref

Return Value

PhpParameter

at line line 106
__construct(string $name = null)

Creates a new PHP parameter

Parameters

string $name the parameter name

at line line 116
$this setPassedByReference(bool $bool)

Sets whether this parameter is passed by reference

Parameters

bool $bool true if passed by reference and false if not

Return Value

$this

at line line 127
bool isPassedByReference()

Returns whether this parameter is passed by reference

Return Value

bool true if passed by reference and false if not

at line line 136
ParamTag getDocblockTag()

Returns a docblock tag for this parameter

Return Value

ParamTag