$defaultPackageName
$defaultPackageName : string
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\File\Collection();
$ files->addDirectories(getcwd());
$parser = new \phpDocumentor\Parser\Parser();
$parser->setPath($files->getProjectRoot());
echo $parser->parseFiles($files);
__construct()
Initializes the parser.
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.
setEncoding(string $encoding) : void
Sets the encoding of the files.
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.
string | $encoding |
parse(\phpDocumentor\Descriptor\ProjectDescriptorBuilder $builder, \phpDocumentor\Fileset\Collection $files) : boolean|string
Iterates through the given files feeds them to the builder.
\phpDocumentor\Descriptor\ProjectDescriptorBuilder | $builder | |
\phpDocumentor\Fileset\Collection | $files | A files container to parse. |
if no files were found.
getFilenames(\phpDocumentor\Fileset\Collection $files) : array<mixed,string>
Extract all filenames from the given collection and output the amount of files.
\phpDocumentor\Fileset\Collection | $files |
if no files were found.
parseFileIntoDescriptor(\phpDocumentor\Descriptor\ProjectDescriptorBuilder $builder, string $filename) : void
Parses a file and creates a Descriptor for it in the project.
\phpDocumentor\Descriptor\ProjectDescriptorBuilder | $builder | |
string | $filename |
forceRebuildIfSettingsHaveModified(\phpDocumentor\Descriptor\ProjectDescriptorBuilder $builder) : void
Checks if the settings of the project have changed and forces a complete rebuild if they have.
\phpDocumentor\Descriptor\ProjectDescriptorBuilder | $builder |
log(string $message, string $priority = \Psr\Log\LogLevel::INFO, array<mixed,string> $parameters = array()) : void
Dispatches a logging request.
string | $message | The message to log. |
string | $priority | The logging priority as declared in the LogLevel PSR-3 class. |
array<mixed,string> | $parameters |