FileDescriptor

in package
extends DescriptorAbstract Implements FileInterface

Represents a file in the project.

Interfaces, Classes & Used Traits

FileInterface
Describes the public interface for a description of a File.

Properties

protected$fqsen  : \phpDocumentor\Reflection\Fqsen                

protected$namespace  : \phpDocumentor\Descriptor\NamespaceDescriptor|string                

protected$package  : \phpDocumentor\Descriptor\PackageDescriptor                

protected$summary  : string                

protected$description  : string                

protected$fileDescriptor  : \phpDocumentor\Descriptor\FileDescriptor|null                

protected$tags  : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\TagDescriptor>>                

protected$errors  : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\Validation\Error>                

protected$inheritedElement  : \phpDocumentor\Descriptor\DescriptorAbstract|null                

protected$hash  : string                

protected$path  : string                

protected$source  : string|null                

protected$namespaceAliases  : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\NamespaceDescriptor>                

protected$includes  : \phpDocumentor\Descriptor\Collection<string>                

protected$constants  : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\ConstantDescriptor>                

protected$functions  : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\FunctionDescriptor>                

protected$classes  : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\ClassDescriptor>                

protected$interfaces  : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\InterfaceDescriptor>                

protected$traits  : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\TraitDescriptor>                

protected$markers  : \phpDocumentor\Descriptor\Collection<array<int|string,mixed>>                

Methods

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.

Returns

mixed

Sets the Fully Qualified Structural Element Name (FQSEN) for this element.

publicsetFullyQualifiedStructuralElementName(Fqsen $name) : void

Parameters

$name : Fqsen

Returns the Fully Qualified Structural Element Name (FQSEN) for this element.

publicgetFullyQualifiedStructuralElementName() : Fqsen|null

Returns

Fqsen|null

Sets the local name for this element.

publicsetName(string $name) : void

Parameters

$name : string

Returns the local name for this element.

publicgetName() : string

Returns

string

Sets the namespace (name) for this element.

publicsetNamespace(NamespaceDescriptor|string $namespace) : void

Parameters

$namespace : NamespaceDescriptor|string

Returns the namespace for this element (defaults to global "\")

publicgetNamespace() : NamespaceDescriptor|string

Sets the summary describing this element in short.

publicsetSummary(string $summary) : void

Parameters

$summary : string

Returns the summary which describes this element.

publicgetSummary() : string

This method will automatically attempt to inherit the parent's summary if this one has none.

Returns

string

Sets a description for this element.

publicsetDescription(string $description) : void

Parameters

$description : string

Returns the description for this element.

publicgetDescription() : string

This method will automatically attempt to inherit the parent's description if this one has none.

Returns

string

Sets the file and linenumber where this element is at.

publicsetLocation(FileDescriptor $file, int $line) : void

Parameters

$file : FileDescriptor
$line : int

Returns the file path relative to the project's root.

publicgetPath() : string

Returns

string

Returns the file in which this element resides or null in case the element is not bound to a file.

publicgetFile() : FileDescriptor|null

Sets the file to which this element is associated.

publicsetFile(FileDescriptor $file) : void

Returns the line number where the definition for this element can be found.

publicgetLine() : int

Returns

int

Sets the line number for this element's location in the source file.

publicsetLine(int $lineNumber) : void

Parameters

$lineNumber : int

Sets the tags associated with this element.

publicsetTags(\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\TagDescriptor>> $tags) : void

Parameters

$tags : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\TagDescriptor>>

Returns the tags associated with this element.

publicgetTags() : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\TagDescriptor>>

Returns

\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\TagDescriptor>>

Sets the name of the package to which this element belongs.

publicsetPackage(PackageDescriptor|string $package) : void

Parameters

$package : PackageDescriptor|string

Returns the package name for this element.

publicgetPackage() : PackageDescriptor|null

publicgetAuthor() : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\Tag\AuthorDescriptor>

Returns

\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\Tag\AuthorDescriptor>

Returns the versions for this element.

publicgetVersion() : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\VersionDescriptor>

Returns

\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\VersionDescriptor>

Returns the copyrights for this element.

publicgetCopyright() : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\TagDescriptor>

Returns

\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\TagDescriptor>

Checks whether this element is deprecated.

publicisDeprecated() : bool

Returns

bool

Sets a list of all errors associated with this element.

publicsetErrors(\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\Validation\Error> $errors) : void

Parameters

$errors : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\Validation\Error>

Returns all errors that occur in this element.

publicgetErrors() : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\Validation\Error>

Returns

\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\Validation\Error>

Dynamically constructs a set of getters to retrieve tag (collections) with.

public__call(string $name, array $arguments) : Collection|mixed|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

Returns

Collection|mixed|null

Represents this object by its unique identifier, the Fully Qualified Structural Element Name.

public__toString() : string

Returns

string

publicgetInheritedElement() : DescriptorAbstract|string|Fqsen|null

Returns

DescriptorAbstract|string|Fqsen|null

Returns the hash of the contents for this file.

publicgetHash() : string

Returns

string

Retrieves the contents of this file.

publicgetSource() : string|null

Returns

string|null

Sets the source contents for this file.

publicsetSource(string|null $source) : void

Parameters

$source : string|null

Returns the namespace aliases that have been defined in this file.

publicgetNamespaceAliases() : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\NamespaceDescriptor>

Returns

\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\NamespaceDescriptor>

Sets the collection of namespace aliases for this file.

publicsetNamespaceAliases(\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\NamespaceDescriptor> $namespaceAliases) : void

Parameters

$namespaceAliases : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\NamespaceDescriptor>

Returns a list of all includes that have been declared in this file.

publicgetIncludes() : \phpDocumentor\Descriptor\Collection

Returns

\phpDocumentor\Descriptor\Collection

Sets a list of all includes that have been declared in this file.

publicsetIncludes(\phpDocumentor\Descriptor\Collection $includes) : void

Parameters

$includes : \phpDocumentor\Descriptor\Collection

Returns a list of constant descriptors contained in this file.

publicgetConstants() : Collection

{@inheritDoc}

Returns

Collection

Sets a list of constant descriptors contained in this file.

publicsetConstants(\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\ConstantDescriptor> $constants) : void

Parameters

$constants : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\ConstantDescriptor>

Returns a list of function descriptors contained in this file.

publicgetFunctions() : Collection

{@inheritDoc}

Returns

Collection

Sets a list of function descriptors contained in this file.

publicsetFunctions(\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\FunctionDescriptor> $functions) : void

Parameters

$functions : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\FunctionDescriptor>

Returns a list of class descriptors contained in this file.

publicgetClasses() : Collection

{@inheritDoc}

Returns

Collection

Sets a list of class descriptors contained in this file.

publicsetClasses(\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\ClassDescriptor> $classes) : void

Parameters

$classes : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\ClassDescriptor>

Returns a list of interface descriptors contained in this file.

publicgetInterfaces() : Collection

{@inheritDoc}

Returns

Collection

Sets a list of interface descriptors contained in this file.

publicsetInterfaces(\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\InterfaceDescriptor> $interfaces) : void

Parameters

$interfaces : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\InterfaceDescriptor>

Returns a list of trait descriptors contained in this file.

publicgetTraits() : Collection

{@inheritDoc}

Returns

Collection

Sets a list of trait descriptors contained in this file.

publicsetTraits(\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\TraitDescriptor> $traits) : void

Parameters

$traits : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\TraitDescriptor>

Returns a series of markers contained in this file.

publicgetMarkers() : \phpDocumentor\Descriptor\Collection>

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.

Returns

\phpDocumentor\Descriptor\Collection>

Sets a series of markers contained in this file.

publicsetMarkers(\phpDocumentor\Descriptor\Collection$markers) : void

Parameters

$markers : \phpDocumentor\Descriptor\Collection>
see
getMarkers()

for more information on markers.

Returns a list of all errors in this file and all its child elements.

publicgetAllErrors() : \phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\Validation\Error>

Returns

\phpDocumentor\Descriptor\Collection<\phpDocumentor\Descriptor\Validation\Error>

Sets the file path for this file relative to the project's root.

publicsetPath(string $path) : void

Parameters

$path : string

Sets the hash of the contents for this file.

protectedsetHash(string $hash) : void

Parameters

$hash : string