MethodDescriptor
extends DescriptorAbstract
in package
implements
MethodInterface, VisibilityInterface
Descriptor representing a Method in a Class, Interface or Trait.
Interfaces, Classes and Traits
- MethodInterface
- Describes the public interface of the description for a method.
- VisibilityInterface
Table of Contents
- $abstract : bool
- $arguments : Collection<string|int, ArgumentDescriptor>
- $description : DescriptionDescriptor|null
- $errors : Collection<string|int, Error>
- $fileDescriptor : FileDescriptor|null
- $final : bool
- $fqsen : Fqsen
- $inheritedElement : DescriptorAbstract|null
- $line : int
- $name : string
- $namespace : NamespaceDescriptor|string
- $package : PackageDescriptor|string
- $parent : ClassDescriptor|InterfaceDescriptor|TraitDescriptor|null
- $static : bool
- $summary : string
- $tags : Collection<string|int, Collection<string|int, TagDescriptor>>
- $visibility : string
- $returnType : Type
- __call() : Collection<string|int, TagDescriptor>|null
- Dynamically constructs a set of getters to retrieve tag (collections) with.
- __construct() : mixed
- Initializes the all properties representing a collection with a new Collection object.
- __toString() : string
- Represents this object by its unique identifier, the Fully Qualified Structural Element Name.
- addArgument() : void
- getArguments() : Collection<string|int, ArgumentDescriptor>
- getAuthor() : Collection<string|int, AuthorDescriptor>
- getCopyright() : Collection<string|int, TagDescriptor>
- Returns the copyrights for this element.
- getDescription() : DescriptionDescriptor|null
- Returns the description for this element.
- getErrors() : Collection<string|int, Error>
- Returns all errors that occur in this element.
- getFile() : FileDescriptor
- Returns the file associated with the parent class, interface or trait.
- getFullyQualifiedStructuralElementName() : Fqsen|null
- Returns the Fully Qualified Structural Element Name (FQSEN) for this element.
- getInheritedElement() : DescriptorAbstract|string|Fqsen|null
- Returns the Method from which this method should inherit its information, if any.
- getLine() : int
- Returns the line number where the definition for this element can be found.
- getName() : string
- Returns the local name for this element.
- getNamespace() : NamespaceDescriptor|string
- Returns the namespace for this element (defaults to global "\")
- getPackage() : PackageDescriptor|null
- Returns the package name for this element.
- getParam() : Collection<string|int, ParamDescriptor>
- getParent() : ClassDescriptor|InterfaceDescriptor|TraitDescriptor|null
- getPath() : string
- Returns the path to the file containing this element relative to the project's root.
- getResponse() : ReturnDescriptor
- getReturn() : Collection<string|int, ReturnDescriptor>
- getSummary() : string
- Returns the summary which describes this element.
- getTags() : Collection<string|int, Collection<string|int, TagDescriptor>>
- Returns the tags associated with this element.
- getVersion() : Collection<string|int, VersionDescriptor>
- Returns the versions for this element.
- getVisibility() : string
- Returns the visibility for this element.
- isAbstract() : bool
- isDeprecated() : bool
- Checks whether this element is deprecated.
- isFinal() : bool
- isStatic() : bool
- setAbstract() : void
- setArguments() : void
- setFinal() : void
- setParent() : void
- setReturnType() : void
- Sets return type of this method.
- setStatic() : void
- setVisibility() : void
Properties
$abstract
protected
bool
$abstract
= false
$arguments
protected
Collection<string|int, ArgumentDescriptor>
$arguments
$description
protected
DescriptionDescriptor|null
$description
A more extensive description of this element.
$errors
protected
Collection<string|int, Error>
$errors
A list of errors found while building this element.
$fileDescriptor
protected
FileDescriptor|null
$fileDescriptor
The file to which this element belongs; if applicable
$final
protected
bool
$final
= false
$fqsen
protected
Fqsen
$fqsen
Fully Qualified Structural Element Name; the FQCN including method, property or constant name
$inheritedElement
protected
DescriptorAbstract|null
$inheritedElement
= null
the element from which to inherit information in this element
$line
protected
int
$line
= 0
The line number on which this element occurs.
$name
protected
string
$name
= ''
The local name for this element
$namespace
protected
NamespaceDescriptor|string
$namespace
= ''
The namespace for this element
$package
protected
PackageDescriptor|string
$package
The package with which this element is associated
$parent
protected
ClassDescriptor|InterfaceDescriptor|TraitDescriptor|null
$parent
$static
protected
bool
$static
= false
$summary
protected
string
$summary
= ''
A summary describing the function of this element in short.
$tags
protected
Collection<string|int, Collection<string|int, TagDescriptor>>
$tags
The tags associated with this element.
$visibility
protected
string
$visibility
= 'public'
$returnType
private
Type
$returnType
Methods
__call()
Dynamically constructs a set of getters to retrieve tag (collections) with.
public
__call(string $name, array<string|int, mixed> $arguments) : Collection<string|int, TagDescriptor>|null
Important: __call() is not a fast method of access; it is preferred to directly use the getTags() collection. This interface is provided to allow for uniform and easy access to certain tags.
Parameters
- $name : string
- $arguments : array<string|int, mixed>
Return values
Collection<string|int, TagDescriptor>|null —__construct()
Initializes the all properties representing a collection with a new Collection object.
public
__construct() : mixed
Return values
mixed —__toString()
Represents this object by its unique identifier, the Fully Qualified Structural Element Name.
public
__toString() : string
Return values
string —addArgument()
public
addArgument(string $name, ArgumentDescriptor $argument) : void
Parameters
- $name : string
- $argument : ArgumentDescriptor
Return values
void —getArguments()
public
getArguments() : Collection<string|int, ArgumentDescriptor>
Return values
Collection<string|int, ArgumentDescriptor> —getAuthor()
public
getAuthor() : Collection<string|int, AuthorDescriptor>
Return values
Collection<string|int, AuthorDescriptor> —getCopyright()
Returns the copyrights for this element.
public
getCopyright() : Collection<string|int, TagDescriptor>
Return values
Collection<string|int, TagDescriptor> —getDescription()
Returns the description for this element.
public
getDescription() : DescriptionDescriptor|null
This method will automatically attempt to inherit the parent's description if this one has none.
Return values
DescriptionDescriptor|null —getErrors()
Returns all errors that occur in this element.
public
getErrors() : Collection<string|int, Error>
Return values
Collection<string|int, Error> —getFile()
Returns the file associated with the parent class, interface or trait.
public
getFile() : FileDescriptor
Return values
FileDescriptor —getFullyQualifiedStructuralElementName()
Returns the Fully Qualified Structural Element Name (FQSEN) for this element.
public
getFullyQualifiedStructuralElementName() : Fqsen|null
Return values
Fqsen|null —getInheritedElement()
Returns the Method from which this method should inherit its information, if any.
public
getInheritedElement() : DescriptorAbstract|string|Fqsen|null
The inheritance scheme for a method is more complicated than for most elements; the following business rules apply:
- if the parent class/interface extends another class or other interfaces (interfaces have multiple
inheritance!) then:
- Check each parent class/interface's parent if they have a method with the exact same name
- if a method is found with the same name; return the first one encountered.
- if the parent is a class and implements interfaces, check each interface for a method with the exact same name. If such a method is found, return the first hit.
Return values
DescriptorAbstract|string|Fqsen|null —getLine()
Returns the line number where the definition for this element can be found.
public
getLine() : int
Return values
int —getName()
Returns the local name for this element.
public
getName() : string
Return values
string —getNamespace()
Returns the namespace for this element (defaults to global "\")
public
getNamespace() : NamespaceDescriptor|string
Return values
NamespaceDescriptor|string —getPackage()
Returns the package name for this element.
public
getPackage() : PackageDescriptor|null
Return values
PackageDescriptor|null —getParam()
public
getParam() : Collection<string|int, ParamDescriptor>
Return values
Collection<string|int, ParamDescriptor> —getParent()
public
getParent() : ClassDescriptor|InterfaceDescriptor|TraitDescriptor|null
Return values
ClassDescriptor|InterfaceDescriptor|TraitDescriptor|null —getPath()
Returns the path to the file containing this element relative to the project's root.
public
getPath() : string
Return values
string —getResponse()
public
getResponse() : ReturnDescriptor
Return values
ReturnDescriptor —getReturn()
public
getReturn() : Collection<string|int, ReturnDescriptor>
Return values
Collection<string|int, ReturnDescriptor> —getSummary()
Returns the summary which describes this element.
public
getSummary() : string
This method will automatically attempt to inherit the parent's summary if this one has none.
Return values
string —getTags()
Returns the tags associated with this element.
public
getTags() : Collection<string|int, Collection<string|int, TagDescriptor>>
Return values
Collection<string|int, Collection<string|int, TagDescriptor>> —getVersion()
Returns the versions for this element.
public
getVersion() : Collection<string|int, VersionDescriptor>
Return values
Collection<string|int, VersionDescriptor> —getVisibility()
Returns the visibility for this element.
public
getVisibility() : string
The following values are supported:
- public
- protected
- private
Return values
string —isAbstract()
public
isAbstract() : bool
Return values
bool —isDeprecated()
Checks whether this element is deprecated.
public
isDeprecated() : bool
Return values
bool —isFinal()
public
isFinal() : bool
Return values
bool —isStatic()
public
isStatic() : bool
Return values
bool —setAbstract()
public
setAbstract(bool $abstract) : void
Parameters
- $abstract : bool
Return values
void —setArguments()
public
setArguments(Collection<string|int, ArgumentDescriptor> $arguments) : void
Parameters
- $arguments : Collection<string|int, ArgumentDescriptor>
Return values
void —setFinal()
public
setFinal(bool $final) : void
Parameters
- $final : bool
Return values
void —setParent()
public
setParent(ClassDescriptor|InterfaceDescriptor|TraitDescriptor $parent) : void
Parameters
Return values
void —setReturnType()
Sets return type of this method.
public
setReturnType(Type $returnType) : void
Parameters
- $returnType : Type
Return values
void —setStatic()
public
setStatic(bool $static) : void
Parameters
- $static : bool
Return values
void —setVisibility()
public
setVisibility(string $visibility) : void
Parameters
- $visibility : string