Add example on writing your own Tag and prepare for TagFactory objects

This commit is contained in:
Mike van Riel
2015-06-28 11:56:16 +02:00
parent a6ffa93e28
commit 216cf0025f
26 changed files with 246 additions and 24 deletions
+9 -3
View File
@@ -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.
*