mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 10:07:12 +00:00
Add example on writing your own Tag and prepare for TagFactory objects
This commit is contained in:
@@ -54,11 +54,12 @@ final class DocBlockFactory implements DocBlockFactoryInterface
|
||||
$tagFactory->addService($descriptionFactory);
|
||||
$tagFactory->addService(new TypeResolver($fqsenResolver));
|
||||
|
||||
foreach ($additionalTags as $tagName => $tagClassName) {
|
||||
$tagFactory->registerTagHandler($tagName, $tagClassName);
|
||||
$docBlockFactory = new self($descriptionFactory, $tagFactory);
|
||||
foreach ($additionalTags as $tagName => $tagHandler) {
|
||||
$docBlockFactory->registerTagHandler($tagName, $tagHandler);
|
||||
}
|
||||
|
||||
return new self($descriptionFactory, $tagFactory);
|
||||
return $docBlockFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,6 +101,11 @@ final class DocBlockFactory implements DocBlockFactoryInterface
|
||||
);
|
||||
}
|
||||
|
||||
public function registerTagHandler($tagName, $handler)
|
||||
{
|
||||
$this->tagFactory->registerTagHandler($tagName, $handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Strips the asterisks from the DocBlock comment.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user