PhpMethod
class PhpMethod extends AbstractPhpMember implements RoutineInterface
Represents a PHP method.
Traits
Constants
| VISIBILITY_PRIVATE |
Private visibility |
| VISIBILITY_PROTECTED |
Protected visibility |
| VISIBILITY_PUBLIC |
Public visibility |
Methods
Sets the description, which will also be used when generating a docblock
Sets the long description
Creates a new member
Returns the parent structure to which this member belongs
A quick way to add a parameter which is created from the given parameters
A quick way to add a parameter with description which is created from the given parameters
Returns a parameter by index or name
Set true if a reference is returned of false if not
Creates a new PHP method.
Generates docblock based on provided information
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 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 TypePart at line line 51
string
getType()
Returns the type
in TypePart at line line 60
string
getTypeDescription()
Returns the type description
at line line 52
__construct(string $name)
Creates a new member
in AbstractPhpMember at line line 87
$this
setVisibility(string $visibility)
Sets the members visibility
in AbstractPhpMember at line line 104
string
getVisibility()
Returns the visibility state of this member
in AbstractPhpMember at line line 114
$this
setStatic(bool $bool)
Sets whether or not this member is static
in AbstractPhpMember at line line 125
bool
isStatic()
Returns whether this member is static
in AbstractPhpMember at line line 136
$this
setParent(AbstractPhpStruct|null $parent)
Sets the parent structure to which this member belongs
in AbstractPhpMember at line line 147
AbstractPhpStruct
getParent()
Returns the parent structure to which this member belongs
in AbstractPart at line line 21
bool
isAbstract()
Returns whether this is abstract
in AbstractPart at line line 31
$this
setAbstract(bool $bool)
Sets this to abstract
in BodyPart at line line 22
$this
setBody(string $body)
Sets the body for this
in BodyPart at line line 33
string
getBody()
Returns the body
in FinalPart at line line 21
bool
isFinal()
Returns whether this is final
in FinalPart at line line 31
$this
setFinal(bool $bool)
Sets this final
in ParametersPart at line line 31
$this
setParameters(array $parameters)
Sets a collection of parameters
Note: clears all parameters before setting the new ones
in ParametersPart at line line 46
$this
addParameter(PhpParameter $parameter)
Adds a parameter
in ParametersPart at line line 58
bool
hasParameter(string $name)
Checks whether a parameter exists
in ParametersPart at line line 77
$this
addSimpleParameter(string $name, null|string $type = null, mixed $defaultValue = null)
A quick way to add a parameter which is created from the given parameters
in ParametersPart at line line 99
$this
addSimpleDescParameter(string $name, null|string $type = null, null|string $typeDescription = null, mixed $defaultValue = null)
A quick way to add a parameter with description which is created from the given parameters
in ParametersPart at line line 119
PhpParameter
getParameter(string|int $nameOrIndex)
Returns a parameter by index or name
in ParametersPart at line line 142
$this
replaceParameter(int $position, PhpParameter $parameter)
Replaces a parameter at a given position
in ParametersPart at line line 155
$this
removeParameter(int|string|PhpParameter $param)
Remove a parameter at a given position
in ParametersPart at line line 197
array
getParameters()
Returns a collection of parameters
in ReferenceReturnPart at line line 22
$this
setReferenceReturned(bool $bool)
Set true if a reference is returned of false if not
in ReferenceReturnPart at line line 33
bool
isReferenceReturned()
Returns whether a reference is returned
at line line 48
static
create(string $name)
Creates a new PHP method.
at line line 60
$this
generateDocblock()
Generates docblock based on provided information