Reflection class for a full file.

author Mike van Riel
license MIT
link http://phpdoc.org

 Methods

Opens the file and retrieves its contents.

__construct(string $file, boolean $validate) 

During construction the given file is checked whether it is readable and if the $validate argument is true a PHP Lint action is executed to check whether the there are no parse errors.

By default the Lint check is disable because of the performance hit introduced by this action.

If the validation checks out the file's contents are read; converted to UTF-8 and the has is created from those contents.

Parameters

$file

string

Name of the file.

$validate

boolean

Whether to check the file using PHP Lint.

Exceptions

\phpDocumentor\Reflection\Exception when the filename is incorrect or the file can not be opened

Adds a marker to scan the contents of this file for.

addMarker(string $name) : void

Parameters

$name

string

The Marker term, i.e. FIXME or TODO.

Adds a parse error to the system

addParserMarker(\phpDocumentor\Parser\Event\LogEvent $data) : void

Parameters

$data

\phpDocumentor\Parser\Event\LogEvent

Contains the type, message, line and code element.

afterTraverse()

afterTraverse(array $nodes) 

Parameters

$nodes

beforeTraverse()

beforeTraverse(array $nodes) 

Parameters

$nodes

Dispatches a logging request to log a debug message.

debug(string $message) : void
Inherited
inherited_from \phpDocumentor\Reflection\ReflectionAbstract::debug()

Parameters

$message

string

The message to log.

enterNode()

enterNode(\PHPParser_Node $node) 

Parameters

$node

getClasses()

getClasses() 

getConstants()

getConstants() 

getContents()

getContents() 

getDefaultPackageName()

getDefaultPackageName() 

getDocBlock()

getDocBlock() 

getFilename()

getFilename() 

getFunctions()

getFunctions() 

getHash()

getHash() 

getIncludes()

getIncludes() 

getInterfaces()

getInterfaces() 

getLineNumber()

getLineNumber() 

getMarkers()

getMarkers() 

getName()

getName() 

getNamespace()

getNamespace() 

getNamespaceAliases()

getNamespaceAliases() 

getParseErrors()

getParseErrors() 

getTraits()

getTraits() 

leaveNode()

leaveNode(\PHPParser_Node $node) 

Parameters

$node

Dispatches a logging request.

log(string $message, int $priority) : void
Inherited
inherited_from \phpDocumentor\Reflection\ReflectionAbstract::log()

Parameters

$message

string

The message to log.

$priority

int

The logging priority, the lower, the more important. Ranges from 1 to 7

process()

process() 

Scans the file for markers and records them in the markers property.

scanForMarkers() : void
see \phpDocumentor\Reflection\getMarkers()
todo this method may incur a performance penalty while the AST also contains the comments. This method should be replaced by a piece of code that interprets the comments in the AST. This has not been done since that may be an extensive refactoring (each PHPParser_Node* contains a 'comments' attribute and must thus recursively be discovered)

setDefaultPackageName()

setDefaultPackageName($default_package_name) 

Parameters

$default_package_name

setFilename()

setFilename($filename) 

Parameters

$filename

Sets a list of markers to search for.

setMarkers(array $markers) : void
see \phpDocumentor\Reflection\FileReflector::addMarker()

Parameters

$markers

string[]

A list of marker terms to scan for.

Checks whether the given node is recogized by phpDocumentor as a documentable element.

isNodeDocumentable(\PHPParser_Node $node) : bool

The following elements are recognized:

  • Trait
  • Class
  • Interface
  • Class constant
  • Class method
  • Property
  • Include/Require
  • Constant, both const and define
  • Function

Parameters

$node

\PHPParser_Node

Returns

bool

 Properties

 

$classes 
 

$constants 
 

$contents 
 

$current_namespace 
 

$default_package_name 
 

$doc_block 
 

$filename 
 

$functions 
 

$hash 
 

$includes 
 

$interfaces 
 

A list of all marker types to search for in this file.

$marker_terms : string[]
 

A list of markers contained in this file.

$markers : string[]
 

$namespace_aliases 
 

A list of errors during processing

$parse_markers : string[]
 

$traits