File
in package
implements
MetaDataContainer
uses
MetadataContainer
Represents a file in the project.
Table of Contents
Interfaces
Properties
- $classes : array<string|int, Class_>
- $constants : array<string|int, Constant>
- $docBlock : DocBlock|null
- $enums : array<string|int, Enum_>
- $functions : array<string|int, Function_>
- $hash : string
- $includes : array<string|int, string>
- $interfaces : array<string|int, Interface_>
- $name : string
- $namespaces : array<string|int, Fqsen>
- $path : string
- $source : string
- $traits : array<string|int, Trait_>
Methods
- __construct() : mixed
- Initializes a new file descriptor with the given hash of its contents.
- addClass() : void
- Add Class to this file.
- addConstant() : void
- Add constant to this file.
- addEnum() : void
- addFunction() : void
- Add function to this file.
- addInclude() : void
- addInterface() : void
- Add interface to this file.
- addNamespace() : void
- Add namespace to file
- addTrait() : void
- Add trait to this file.
- getClasses() : array<string|int, Class_>
- Returns a list of class descriptors contained in this file.
- getConstants() : array<string|int, Constant>
- Returns a list of constant descriptors contained in this file.
- getDocBlock() : DocBlock|null
- Returns the DocBlock of the element if available
- getEnums() : array<string|int, Enum_>
- Returns a list of enum descriptors contained in this file.
- getFunctions() : array<string|int, Function_>
- Returns a list of function descriptors contained in this file.
- getHash() : string
- Returns the hash of the contents for this file.
- getIncludes() : array<string|int, string>
- Returns a list of all includes that have been declared in this file.
- getInterfaces() : array<string|int, Interface_>
- Returns a list of interface descriptors contained in this file.
- getName() : string
- Returns the full name of this file
- getNamespaces() : array<string|int, Fqsen>
- Returns the namespace fqsens that have been defined in this file.
- getPath() : string
- Returns the file path relative to the project's root.
- getSource() : string
- Retrieves the contents of this file.
- getTraits() : array<string|int, Trait_>
- Returns a list of trait descriptors contained in this file.
Properties
$classes
private
array<string|int, Class_>
$classes
= []
$constants
private
array<string|int, Constant>
$constants
= []
$docBlock read-only
private
DocBlock|null
$docBlock
= null
$enums
private
array<string|int, Enum_>
$enums
= []
$functions
private
array<string|int, Function_>
$functions
= []
$hash read-only
private
string
$hash
$includes
private
array<string|int, string>
$includes
= []
$interfaces
private
array<string|int, Interface_>
$interfaces
= []
$name read-only
private
string
$name
$namespaces
private
array<string|int, Fqsen>
$namespaces
= []
$path read-only
private
string
$path
$source read-only
private
string
$source
= ''
$traits
private
array<string|int, Trait_>
$traits
= []
Methods
__construct()
Initializes a new file descriptor with the given hash of its contents.
public
__construct(string $hash, string $path[, string $source = '' ][, DocBlock|null $docBlock = null ]) : mixed
Parameters
- $hash : string
-
An MD5 hash of the contents if this file.
- $path : string
- $source : string = ''
- $docBlock : DocBlock|null = null
addClass()
Add Class to this file.
public
addClass(Class_ $class) : void
Parameters
- $class : Class_
addConstant()
Add constant to this file.
public
addConstant(Constant $constant) : void
Parameters
- $constant : Constant
addEnum()
public
addEnum(Enum_ $enum) : void
Parameters
- $enum : Enum_
addFunction()
Add function to this file.
public
addFunction(Function_ $function) : void
Parameters
- $function : Function_
addInclude()
public
addInclude(string $include) : void
Parameters
- $include : string
addInterface()
Add interface to this file.
public
addInterface(Interface_ $interface) : void
Parameters
- $interface : Interface_
addNamespace()
Add namespace to file
public
addNamespace(Fqsen $fqsen) : void
Parameters
- $fqsen : Fqsen
addTrait()
Add trait to this file.
public
addTrait(Trait_ $trait) : void
Parameters
- $trait : Trait_
getClasses()
Returns a list of class descriptors contained in this file.
public
getClasses() : array<string|int, Class_>
Return values
array<string|int, Class_>getConstants()
Returns a list of constant descriptors contained in this file.
public
getConstants() : array<string|int, Constant>
Return values
array<string|int, Constant>getDocBlock()
Returns the DocBlock of the element if available
public
getDocBlock() : DocBlock|null
Return values
DocBlock|nullgetEnums()
Returns a list of enum descriptors contained in this file.
public
getEnums() : array<string|int, Enum_>
Return values
array<string|int, Enum_>getFunctions()
Returns a list of function descriptors contained in this file.
public
getFunctions() : array<string|int, Function_>
Return values
array<string|int, Function_>getHash()
Returns the hash of the contents for this file.
public
getHash() : string
Return values
stringgetIncludes()
Returns a list of all includes that have been declared in this file.
public
getIncludes() : array<string|int, string>
Return values
array<string|int, string>getInterfaces()
Returns a list of interface descriptors contained in this file.
public
getInterfaces() : array<string|int, Interface_>
Return values
array<string|int, Interface_>getName()
Returns the full name of this file
public
getName() : string
Return values
stringgetNamespaces()
Returns the namespace fqsens that have been defined in this file.
public
getNamespaces() : array<string|int, Fqsen>
Return values
array<string|int, Fqsen>getPath()
Returns the file path relative to the project's root.
public
getPath() : string
Return values
stringgetSource()
Retrieves the contents of this file.
public
getSource() : string
Return values
stringgetTraits()
Returns a list of trait descriptors contained in this file.
public
getTraits() : array<string|int, Trait_>