You are here

final public static function Tag::registerTagHandler in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag.php \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler()

Registers a handler for tags.

Registers a handler for tags. The class specified is autoloaded if it's not available. It must inherit from this class.

Parameters

string $tag Name of tag to regiser a handler for. When: registering a namespaced tag, the full name, along with a prefixing slash MUST be provided.

string|null $handler FQCN of handler. Specifing NULL removes the: handler for the specified tag, if any.

Return value

bool TRUE on success, FALSE on failure.

6 calls to Tag::registerTagHandler()
TagTest::testIncompatibleTagHandlerRegistration in vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php
@covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler
TagTest::testNamespacedTagHandlerCorrectRegistration in vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php
@depends testTagHandlerCorrectRegistration @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler @covers \phpDocumentor\Reflection\DocBlock\Tag::createInstance
TagTest::testNamespacedTagHandlerIncorrectRegistration in vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php
@depends testTagHandlerCorrectRegistration @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler @covers \phpDocumentor\Reflection\DocBlock\Tag::createInstance
TagTest::testNonExistentTagHandlerRegistration in vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php
@covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler
TagTest::testTagHandlerCorrectRegistration in vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php
@covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler

... See full list

File

vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag.php, line 163

Class

Tag
Parses a tag definition for a DocBlock.

Namespace

phpDocumentor\Reflection\DocBlock

Code

public static final function registerTagHandler($tag, $handler) {
  $tag = trim((string) $tag);
  if (null === $handler) {
    unset(self::$tagHandlerMappings[$tag]);
    return true;
  }
  if ('' !== $tag && class_exists($handler, true) && is_subclass_of($handler, __CLASS__) && !strpos($tag, '\\')) {
    self::$tagHandlerMappings[$tag] = $handler;
    return true;
  }
  return false;
}