1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
<?php
if (stream_resolve_include_path(__DIR__ . '/../../src/DocBlock/autoload.php')) {
include_once __DIR__ . '/../../src/DocBlock/autoload.php';
} elseif (stream_resolve_include_path(__DIR__ . '/../../../phpDocumentor/Reflection/DocBlock/autoload.php')) {
include_once('/../../../phpDocumentor/Reflection/DocBlock/autoload.php');
}
use phpDocumentor\Reflection\DocBlock\Serializer;
use phpDocumentor\Reflection\DocBlockFactory;
$docComment = <<<DOCCOMMENT
/**
* This is an example of a summary.
*
* And here is an example of the description
* of a DocBlock that can span multiple lines.
*
* @see \phpDocumentor\Reflection\DocBlock\StandardTagFactory
*/
DOCCOMMENT;
$factory = DocBlockFactory::createInstance();
$docblock = $factory->create($docComment);
// Create the serializer that will reconstitute the DocBlock back to its original form.
$serializer = new Serializer(0, '', true, null, null, PHP_EOL);
// Reconstitution is performed by the `getDocComment()` method.
$reconstitutedDocComment = $serializer->getDocComment($docblock);
|