Class responsible for parsing the given file or files to the intermediate structure file.

This class can be used to parse one or more files to the intermediate file format for further processing. Example of use: $files = new phpDocumentor_Parser_Files(); $files->addDirectories(getcwd()); $parser = new phpDocumentor_Parser(); $parser->setPath($files->getProjectRoot()); echo $parser->parseFiles($files);

category phpDocumentor
package Parser
author Mike van Riel
license MIT
link http://phpdoc.org

 Methods

Dispatches a logging request to log a debug message.

debug(string $message) : void
Inherited

inherited_from \phpDocumentor_Parser_Abstract::debug()

Parameters

$message

string

The message to log.

Dispatches an event to the Event Dispatcher.

dispatch(string $name, \string[] $arguments) : mixed | null
Inherited

This method tries to dispatch an event; if no Event Dispatcher has been set than this method will explicitly not fail and return null. By not failing we make the Event Dispatcher optional and is it easier for people to re-use this component in their own application.

inherited_from \phpDocumentor_Parser_Abstract::dispatch()

Parameters

$name

string

Name of the event to dispatch.

$arguments

\string[]

Arguments for this event.

Exceptions

\phpDocumentor_Parser_Exception if there is a dispatcher but it is not of type sfEventDispatcher

Returns

mixednull

Returns whether we want to run PHPLint on every file.

doValidation() : bool
API

api

Returns

bool

Returns the name of the default package.

getDefaultPackageName() : string

Returns

string

Returns the existing data structure as DOMDocument.

getExistingXml() : \DOMDocument | null
API

api

Returns

Returns the list of ignored tags.

getIgnoredTags() : \string[]
API

api

Returns

\string[]

Returns the list of markers.

getMarkers() : \string[]
API

api

Returns

\string[]

Returns the filename, relative to the root of the project directory.

getRelativeFilename(string $filename) : string

Parameters

$filename

string

The filename to make relative.

Exceptions

\InvalidArgumentException if file is not in the project root.

Returns

string

Returns the HTML text which is found at the title's position.

getTitle() : null | string
API

api

Returns

nullstring

Returns which elements' are allowed to be returned by visibility.

getVisibility() : \string[]

Returns

\string[]

Returns whether a full rebuild is required.

isForced() : bool
API

To prevent incompatibilities we force a full rebuild if the version of phpDocumentor does not equal the structure's version.

api

Returns

bool

Dispatches a logging request.

log(string $message, int $priority) : void
Inherited

inherited_from \phpDocumentor_Parser_Abstract::log()

Parameters

$message

string

The message to log.

$priority

int

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

Runs a file through the static reflectors, generates an XML file element and returns it.

parseFile(string $filename, bool $include_source) : void
API

api

Parameters

$filename

string

The filename to parse.

$include_source

bool

whether to include the source in the generated output.

Iterates through the given files and builds the structure.xml file.

parseFiles(phpDocumentor_Parser_Files $files, bool $include_source) : bool | string
API

api

Parameters

$files

\phpDocumentor_Parser_Files

A files container to parse.

$include_source

bool

whether to include the source in the generated output..

Returns

boolstring

Sets the name of the defautl package.

setDefaultPackageName(string $default_package_name) : void

Parameters

$default_package_name

string

Name used to categorize elements without an @package tag.

Imports an existing XML source to enable incremental parsing.

setExistingXml(string | null $xml) : void
API

api

Parameters

$xml

stringnull

XML contents if a source exists, otherwise null.

Sets whether to force a full parse run of all files.

setForced(bool $forced) : void
API

api

Parameters

$forced

bool

Forces a full parse.

Sets a list of tags to ignore.

setIgnoredTags(array $ignored_tags) : void
API

api

Parameters

$ignored_tags

\string[]

A list of tags to ignore.

Sets a list of markers to gather (i.e. TODO, FIXME).

setMarkers(array $markers) : void
API

api

Parameters

$markers

\string[]

A list or markers to gather.

Sets the base path of the files that will be parsed.

setPath(string $path) : void
API

api

Parameters

$path

string

Must be an absolute path.

Sets the title for this project.

setTitle(string $title) : void
API

api

Parameters

$title

string

The intended title for this project.

Sets whether to run PHPLint on every file.

setValidate(bool $validate) : void
API

PHPLint has a huge performance impact on the execution of phpDocumentor and is thus disabled by default.

api

Parameters

$validate

bool

when true this file will be checked.

Set the visibility of the methods/properties that should be documented

setVisibility(string $visibility) : void
API

api

Parameters

$visibility

string

Comma seperated string of visibility modifiers

 Properties

 

The event dispatcher object, may be null to not dispatch events.

$event_dispatcher : \sfEventDispatcher | null
Inherited

inherited_from \phpDocumentor_Parser_Abstract::$$event_dispatcher
 

<p>the name of the default package</p>

$default_package_name : string

 

<p>if any structure.xml was at the target location it is stored for comparison</p>

$existing_xml : \DOMDocument | null

 

$exporter

$exporter : \phpDocumentor_Parser_Exporter_Abstract

 

<p>whether we force a full re-parse, independent of existing_xml is set</p>

$force : bool

 

<p>which tags to ignore</p>

$ignored_tags : \string[]

 

<p>which markers (i.e. TODO or FIXME) to collect</p>

$markers : \string[]

 

<p>target location's root path</p>

$path : string

 

<p>the title to use in the header</p>

$title : string

 

<p>whether to execute a PHPLint on every file</p>

$validate : bool

 

Array of visibility modifiers that should be adhered to when generating the documentation

$visibility : array