Parser
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.
Properties
$defaultPackageName Line 40
private$defaultPackageName : string
$validate Line 43
private$validate : bool
$markers Line 46
private$markers : string[]
$ignoredTags Line 49
private$ignoredTags : string[]
$path Line 52
private$path : string
$logger Line 55
private$logger : \Psr\Log\LoggerInterface
$encoding Line 58
private$encoding : string
$stopwatch Line 61
private$stopwatch : \Symfony\Component\Stopwatch\Stopwatch
$projectFactory Line 64
private$projectFactory : \phpDocumentor\Reflection\ProjectFactory
Methods
__construct() Line 76
Initializes the parser.
public__construct(ProjectFactory $projectFactory, Stopwatch $stopwatch, LoggerInterface $logger) : mixed
This constructor checks the user's PHP ini settings to detect which encoding is used by default. This encoding is used as a default value for phpDocumentor to convert the source files that it receives.
If no encoding is specified than 'utf-8' is assumed by default.
Parameters
Returns
mixed —
setValidate() Line 96
Sets whether to run PHPLint on every file.
publicsetValidate(bool $validate) : void
PHPLint has a huge performance impact on the execution of phpDocumentor and is thus disabled by default.
Parameters
when true this file will be checked.
doValidation() Line 104
Returns whether we want to run PHPLint on every file.
publicdoValidation() : bool
Returns
bool —
setMarkers() Line 114
Sets a list of markers to gather (i.e. TODO, FIXME).
publicsetMarkers(string[] $markers) : void
Parameters
A list or markers to gather.
Returns
string[] —
setIgnoredTags() Line 134
Sets a list of tags to ignore.
publicsetIgnoredTags(string[] $ignoredTags) : void
Parameters
A list of tags to ignore.
Returns
string[] —
setPath() Line 154
Sets the base path of the files that will be parsed.
publicsetPath(string $path) : void
Parameters
Must be an absolute path.
Returns
string —
setDefaultPackageName() Line 173
Sets the name of the default package.
publicsetDefaultPackageName(string $defaultPackageName) : void
Parameters
Name used to categorize elements without an @package tag.
getDefaultPackageName() Line 181
Returns the name of the default package.
publicgetDefaultPackageName() : string
Returns
string —With this option it is possible to tell the parser to use a specific encoding to interpret the provided files.
By default this is set to UTF-8, in which case no action is taken. Any other encoding will result in the output
being converted to UTF-8 using iconv
.
Please note that it is recommended to provide files in UTF-8 format; this will ensure a faster performance since no transformation is required.
Parameters
Returns
string —
parse() Line 214
Iterates through the given files feeds them to the builder.
publicparse(\phpDocumentor\Reflection\File[] $files) : Project
Parameters
Returns
Project —
logAfterParsingAllFiles() Line 236
Writes the complete parsing cycle to log.
privatelogAfterParsingAllFiles() : void
log() Line 251
Dispatches a logging request.
privatelog(string $message[, string $priority = LogLevel::INFO ][, string[] $parameters = [] ]) : void
Parameters
The message to log.
The logging priority as declared in the LogLevel PSR-3 class.