FileReflection
in package
implements
ReflectionInterface
Interfaces, Classes, Traits and Enums
Table of Contents
- $classes : array<string|int, ClassReflection>
- $contents : string
- $docComment : string
- $endLine : int
- $filePath : string
- $functions : array<string|int, FunctionReflection>
- $namespaces : array<string|int, string>
- $requiredFiles : array<string|int, string>
- $startLine : int
- $uses : array<string|int, string>
- __construct() : mixed
- __toString() : string
- Serialize to string
- export() : void
- Required by the Reflector interface.
- getClass() : ClassReflection
- Retrieve the reflection class of a given class found in this file
- getClasses() : array<string|int, ClassReflection>
- Return the reflection classes of the classes found inside this file
- getContents() : string
- Return the full contents of file
- getDocBlock() : DocBlockReflection|false
- getDocComment() : string
- getEndLine() : int
- Get the end line / number of lines
- getFileName() : string
- Return the file name of the reflected file
- getFunctions() : array<string|int, FunctionReflection>
- Return the reflection functions of the functions found inside this file
- getNamespace() : null|string
- getNamespaces() : array<string|int, string>
- getStartLine() : int
- Get the start line - Always 1, staying consistent with the Reflection API
- getUses() : array<string|int, mixed>
- toString() : string
- checkFileDocBlock() : void
- Validate / check a file level DocBlock
- reflect() : void
- This method does the work of "reflecting" the file
Properties
$classes
protected
array<string|int, ClassReflection>
$classes
= []
$contents
protected
string
$contents
$docComment
protected
string
$docComment
$endLine
protected
int
$endLine
$filePath
protected
string
$filePath
$functions
protected
array<string|int, FunctionReflection>
$functions
= []
$namespaces
protected
array<string|int, string>
$namespaces
= []
$requiredFiles
protected
array<string|int, string>
$requiredFiles
= []
$startLine
protected
int
$startLine
= 1
$uses
protected
array<string|int, string>
$uses
= []
Methods
__construct()
public
__construct(string $filename[, bool $includeIfNotAlreadyIncluded = false ]) : mixed
Parameters
- $filename : string
- $includeIfNotAlreadyIncluded : bool = false
Tags
Return values
mixed —__toString()
Serialize to string
public
__toString() : string
Required by the Reflector interface
Tags
Return values
string —export()
Required by the Reflector interface.
public
static export() : void
Tags
Return values
void —getClass()
Retrieve the reflection class of a given class found in this file
public
getClass([null|string $name = null ]) : ClassReflection
Parameters
- $name : null|string = null
Tags
Return values
ClassReflection —getClasses()
Return the reflection classes of the classes found inside this file
public
getClasses() : array<string|int, ClassReflection>
Return values
array<string|int, ClassReflection> —getContents()
Return the full contents of file
public
getContents() : string
Return values
string —getDocBlock()
public
getDocBlock() : DocBlockReflection|false
Return values
DocBlockReflection|false —getDocComment()
public
getDocComment() : string
Return values
string —getEndLine()
Get the end line / number of lines
public
getEndLine() : int
Return values
int —getFileName()
Return the file name of the reflected file
public
getFileName() : string
Return values
string —getFunctions()
Return the reflection functions of the functions found inside this file
public
getFunctions() : array<string|int, FunctionReflection>
Return values
array<string|int, FunctionReflection> —getNamespace()
public
getNamespace() : null|string
Return values
null|string —getNamespaces()
public
getNamespaces() : array<string|int, string>
Return values
array<string|int, string> —getStartLine()
Get the start line - Always 1, staying consistent with the Reflection API
public
getStartLine() : int
Return values
int —getUses()
public
getUses() : array<string|int, mixed>
Return values
array<string|int, mixed> —toString()
public
toString() : string
Return values
string —checkFileDocBlock()
Validate / check a file level DocBlock
protected
checkFileDocBlock(array<string|int, mixed> $tokens) : void
Parameters
- $tokens : array<string|int, mixed>
-
Array of tokenizer tokens
Return values
void —reflect()
This method does the work of "reflecting" the file
protected
reflect() : void
Uses Laminas\Code\Scanner\FileScanner to gather file information