Documentation

File
in package
implements MetaDataContainer Uses MetadataContainer

Represents a file in the project.

Interfaces, Classes and Traits

MetaDataContainer

Table of Contents

$classes  : array<string|int, mixed>
$constants  : array<string|int, mixed>
$docBlock  : DocBlock|null
$enums  : array<string|int, mixed>
$functions  : array<string|int, mixed>
$hash  : string
$includes  : array<string|int, mixed>
$interfaces  : array<string|int, mixed>
$name  : string
$namespaces  : array<string|int, mixed>
$path  : string
$source  : string
$traits  : array<string|int, mixed>
__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, mixed> $classes = []

$constants

private array<string|int, mixed> $constants = []

$enums

private array<string|int, mixed> $enums = []

$functions

private array<string|int, mixed> $functions = []

$hash

private string $hash

$includes

private array<string|int, mixed> $includes = []

$interfaces

private array<string|int, mixed> $interfaces = []

$name

private string $name

$namespaces

private array<string|int, mixed> $namespaces = []

$path

private string $path

$source

private string $source

$traits

private array<string|int, mixed> $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
Return values
mixed

addClass()

Add Class to this file.

public addClass(Class_ $class) : void
Parameters
$class : Class_
Return values
void

addConstant()

Add constant to this file.

public addConstant(Constant $constant) : void
Parameters
$constant : Constant
Return values
void

addEnum()

public addEnum(Enum_ $enum) : void
Parameters
$enum : Enum_
Return values
void

addFunction()

Add function to this file.

public addFunction(Function_ $function) : void
Parameters
$function : Function_
Return values
void

addInclude()

public addInclude(string $include) : void
Parameters
$include : string
Return values
void

addInterface()

Add interface to this file.

public addInterface(Interface_ $interface) : void
Parameters
$interface : Interface_
Return values
void

addNamespace()

Add namespace to file

public addNamespace(Fqsen $fqsen) : void
Parameters
$fqsen : Fqsen
Return values
void

addTrait()

Add trait to this file.

public addTrait(Trait_ $trait) : void
Parameters
$trait : Trait_
Return values
void

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|null

getEnums()

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
string

getIncludes()

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
string

getNamespaces()

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
string

getSource()

Retrieves the contents of this file.

public getSource() : string
Return values
string

getTraits()

Returns a list of trait descriptors contained in this file.

public getTraits() : array<string|int, Trait_>
Return values
array<string|int, Trait_>

Search results