Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on Apr 23, 2024 via composer

phpdocumentor/reflection-docblock 5.3.0

With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
Package summary
Share
0
issues
1
license
6
MIT
Package created
8 May 2012
Version published
19 Oct 2021
Maintainers
3
Total deps
6
Direct deps
3
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
6 Packages, Including:
doctrine/deprecations@1.1.3
phpdocumentor/reflection-common@2.2.0
phpdocumentor/reflection-docblock@5.3.0
phpdocumentor/type-resolver@1.8.2
phpstan/phpdoc-parser@1.28.0
webmozart/assert@1.11.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

3
All Dependencies CSV
β“˜ This is a list of phpdocumentor/reflection-docblock 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
phpdocumentor/reflection-common2.2.08.06 kBMIT
prod
phpdocumentor/type-resolver1.8.2-MIT
prod
webmozart/assert1.11.019.58 kBMIT
prod

Visualizations

Frequently Asked Questions

What does phpdocumentor/reflection-docblock do?

The phpdocumentor/reflection-docblock is a DocBlock parser for PHP that is 100% compatible with the PHPDoc standard. It enables a library to support annotations via DocBlocks and to retrieve information embedded in a DocBlock. The tool is part of the phpDocumentor suite of tools which are widely used in PHP development for their ability to generate high-quality documentation for PHP code.

How do you use phpdocumentor/reflection-docblock?

To use phpdocumentor/reflection-docblock, start by installing it using composer with the command composer require phpdocumentor/reflection-docblock.

Then create a DocBlockFactory instance with the createInstance factory method:

$factory = \phpDocumentor\Reflection\DocBlockFactory::createInstance();

After that, invoke the create method of the factory to parse the DocBlock:

$docComment = <<<DOCCOMMENT
/**
 * This is an example of a summary.
 *
 * This is a Description. A Summary and Description are separated by either
 * two subsequent newlines (thus a whiteline in between as can be seen in this
 * example), or when the Summary ends with a dot (`.`) and some form of
 * whitespace.
 */
DOCCOMMENT;

$docblock = $factory->create($docComment);

Finally, you can interrogate the methods of the object yielded by create, which is an instance of \phpDocumentor\Reflection\DocBlock:

$summary = $docblock->getSummary();
$description = $docblock->getDescription();
$description = (string) $docblock->getDescription();
$description = $docblock->getDescription()->render();

Where are the phpdocumentor/reflection-docblock docs?

For the documentation of phpdocumentor/reflection-docblock, check out the /examples folder in the project repository at GitHub. It contains several scripts that demonstrate usage of the library. You'll find detailed examples that shed more light on how to use the parsed elements to write and read PHPDocs effectively.