FileDescriptor
extends DescriptorAbstract
in package
implements
FileInterface
Represents a file in the project.
This class contains all structural elements of the file it represents. In most modern projects a file will contain a single element like a Class, Interface or Trait, sometimes multiple functions. Depending on the config settings of the parsed project it might include all source code from the file in the project.
Interfaces, Classes and Traits
- FileInterface
- Describes the public interface for a description of a File.
Table of Contents
- $classes : Collection<string|int, ClassDescriptor>
- $constants : Collection<string|int, ConstantDescriptor>
- $description : DescriptionDescriptor|null
- $errors : Collection<string|int, Error>
- $fileDescriptor : FileDescriptor|null
- $fqsen : Fqsen
- $functions : Collection<string|int, FunctionDescriptor>
- $hash : string
- $includes : Collection<string|int, string>
- $inheritedElement : DescriptorAbstract|null
- $interfaces : Collection<string|int, InterfaceDescriptor>
- $line : int
- $markers : Collection<string|int, array<int|string, mixed>>
- $name : string
- $namespace : NamespaceDescriptor|string
- $namespaceAliases : Collection<string|int, NamespaceDescriptor>|Collection<string|int, Fqsen>
- $package : PackageDescriptor|string
- $path : string
- $source : string|null
- $summary : string
- $tags : Collection<string|int, Collection<string|int, TagDescriptor>>
- $traits : Collection<string|int, TraitDescriptor>
- __call() : Collection<string|int, TagDescriptor>|null
- Dynamically constructs a set of getters to retrieve tag (collections) with.
- __construct() : mixed
- Initializes a new file descriptor with the given hash of its contents.
- __toString() : string
- Represents this object by its unique identifier, the Fully Qualified Structural Element Name.
- getAllErrors() : Collection<string|int, Error>
- Returns a list of all errors in this file and all its child elements.
- getAuthor() : Collection<string|int, AuthorDescriptor>
- getClasses() : Collection
- Returns a list of class descriptors contained in this file.
- getConstants() : Collection
- Returns a list of constant descriptors contained in this file.
- 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|null
- Returns the file in which this element resides or null in case the element is not bound to a file.
- getFullyQualifiedStructuralElementName() : Fqsen|null
- Returns the Fully Qualified Structural Element Name (FQSEN) for this element.
- getFunctions() : Collection
- Returns a list of function descriptors contained in this file.
- getHash() : string
- Returns the hash of the contents for this file.
- getIncludes() : Collection<string|int, string>
- Returns a list of all includes that have been declared in this file.
- getInheritedElement() : DescriptorAbstract|string|Fqsen|null
- getInterfaces() : Collection
- Returns a list of interface descriptors contained in this file.
- getLine() : int
- Returns the line number where the definition for this element can be found.
- getMarkers() : Collection<string|int, array<int|string, mixed>>
- Returns a series of markers contained in this file.
- getName() : string
- Returns the local name for this element.
- getNamespace() : NamespaceDescriptor|string
- Returns the namespace for this element (defaults to global "\")
- getNamespaceAliases() : Collection<string|int, NamespaceDescriptor>|Collection<string|int, Fqsen>
- Returns the namespace aliases that have been defined in this file.
- getPackage() : PackageDescriptor|null
- Returns the package name for this element.
- getPath() : string
- Returns the relative file path.
- getSource() : string|null
- Retrieves the contents of this file.
- getSummary() : string
- Returns the summary which describes this element.
- getTags() : Collection<string|int, Collection<string|int, TagDescriptor>>
- Returns the tags associated with this element.
- getTraits() : Collection
- Returns a list of trait descriptors contained in this file.
- getVersion() : Collection<string|int, VersionDescriptor>
- Returns the versions for this element.
- isDeprecated() : bool
- Checks whether this element is deprecated.
- setHash() : void
- Sets the hash of the contents for this file.
Properties
$classes
protected
Collection<string|int, ClassDescriptor>
$classes
$constants
protected
Collection<string|int, ConstantDescriptor>
$constants
$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
$fqsen
protected
Fqsen
$fqsen
Fully Qualified Structural Element Name; the FQCN including method, property or constant name
$functions
protected
Collection<string|int, FunctionDescriptor>
$functions
$hash
protected
string
$hash
$includes
protected
Collection<string|int, string>
$includes
$inheritedElement
protected
DescriptorAbstract|null
$inheritedElement
= null
the element from which to inherit information in this element
$interfaces
protected
Collection<string|int, InterfaceDescriptor>
$interfaces
$line
protected
int
$line
= 0
The line number on which this element occurs.
$markers
protected
Collection<string|int, array<int|string, mixed>>
$markers
$name
protected
string
$name
= ''
The local name for this element
$namespace
protected
NamespaceDescriptor|string
$namespace
= ''
The namespace for this element
$namespaceAliases
protected
Collection<string|int, NamespaceDescriptor>|Collection<string|int, Fqsen>
$namespaceAliases
$package
protected
PackageDescriptor|string
$package
The package with which this element is associated
$path
protected
string
$path
= ''
$source
protected
string|null
$source
= null
$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.
$traits
protected
Collection<string|int, TraitDescriptor>
$traits
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 a new file descriptor with the given hash of its contents.
public
__construct(string $hash) : mixed
Parameters
- $hash : string
-
An MD5 hash of the contents if this file.
Return values
mixed —__toString()
Represents this object by its unique identifier, the Fully Qualified Structural Element Name.
public
__toString() : string
Return values
string —getAllErrors()
Returns a list of all errors in this file and all its child elements.
public
getAllErrors() : Collection<string|int, Error>
All errors from structual elements in the file are collected to the deepes level.
Return values
Collection<string|int, Error> —getAuthor()
public
getAuthor() : Collection<string|int, AuthorDescriptor>
Return values
Collection<string|int, AuthorDescriptor> —getClasses()
Returns a list of class descriptors contained in this file.
public
getClasses() : Collection
Return values
Collection —getConstants()
Returns a list of constant descriptors contained in this file.
public
getConstants() : Collection
Return values
Collection —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 in which this element resides or null in case the element is not bound to a file.
public
getFile() : FileDescriptor|null
.
Return values
FileDescriptor|null —getFullyQualifiedStructuralElementName()
Returns the Fully Qualified Structural Element Name (FQSEN) for this element.
public
getFullyQualifiedStructuralElementName() : Fqsen|null
Return values
Fqsen|null —getFunctions()
Returns a list of function descriptors contained in this file.
public
getFunctions() : Collection
Return values
Collection —getHash()
Returns the hash of the contents for this file.
public
getHash() : string
Return values
string —getIncludes()
Returns a list of all includes that have been declared in this file.
public
getIncludes() : Collection<string|int, string>
Return values
Collection<string|int, string> —getInheritedElement()
public
getInheritedElement() : DescriptorAbstract|string|Fqsen|null
Return values
DescriptorAbstract|string|Fqsen|null —getInterfaces()
Returns a list of interface descriptors contained in this file.
public
getInterfaces() : Collection
Return values
Collection —getLine()
Returns the line number where the definition for this element can be found.
public
getLine() : int
Return values
int —getMarkers()
Returns a series of markers contained in this file.
public
getMarkers() : Collection<string|int, array<int|string, mixed>>
A marker is a special inline comment that starts with a keyword and is followed by a single line description.
Example:
// TODO: This is an item that needs to be done.
Return values
Collection<string|int, array<int|string, mixed>> —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 —getNamespaceAliases()
Returns the namespace aliases that have been defined in this file.
public
getNamespaceAliases() : Collection<string|int, NamespaceDescriptor>|Collection<string|int, Fqsen>
A namespace alias can either be a full descriptor of the namespace or just a Fqsen when the namespace was not part of the processed code. When it is a NamespaceDescriptor it will contain all structural elements in the namespace not just the once in this particlar file.
Return values
Collection<string|int, NamespaceDescriptor>|Collection<string|int, Fqsen> —getPackage()
Returns the package name for this element.
public
getPackage() : PackageDescriptor|null
Return values
PackageDescriptor|null —getPath()
Returns the relative file path.
public
getPath() : string
The path is a relative to the source file based on the dsn of the config.
Return values
string —getSource()
Retrieves the contents of this file.
public
getSource() : string|null
When source is included in parsing process this property will contain the raw file contents.
Return values
string|null —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>> —getTraits()
Returns a list of trait descriptors contained in this file.
public
getTraits() : Collection
Return values
Collection —getVersion()
Returns the versions for this element.
public
getVersion() : Collection<string|int, VersionDescriptor>
Return values
Collection<string|int, VersionDescriptor> —isDeprecated()
Checks whether this element is deprecated.
public
isDeprecated() : bool
Return values
bool —setHash()
Sets the hash of the contents for this file.
protected
setHash(string $hash) : void
Parameters
- $hash : string