本文整理汇总了PHP中phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler方法的典型用法代码示例。如果您正苦于以下问题:PHP Tag::registerTagHandler方法的具体用法?PHP Tag::registerTagHandler怎么用?PHP Tag::registerTagHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpDocumentor\Reflection\DocBlock\Tag
的用法示例。
在下文中一共展示了Tag::registerTagHandler方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDocBlock
/**
*
* @return \phpDocumentor\Reflection\DocBlock
*/
protected function getDocBlock()
{
if (!self::$registered) {
Tag::registerTagHandler('requiresRight', '\\oat\\tao\\model\\controllerMap\\RequiresRightTag');
self::$registered = true;
}
return new DocBlock($this->method);
}
示例2: registerTagHandlers
/**
* Registers all tags handlers.
*/
public static function registerTagHandlers()
{
static $isRegistered;
if (!$isRegistered) {
$mapping = ['query' => '\\pahanini\\restdoc\\tags\\QueryTag', 'field' => '\\phpDocumentor\\Reflection\\DocBlock\\Tag\\ParamTag', 'link' => '\\phpDocumentor\\Reflection\\DocBlock\\Tag\\ParamTag', 'label' => '\\phpDocumentor\\Reflection\\DocBlock\\Tag', 'extraField' => '\\phpDocumentor\\Reflection\\DocBlock\\Tag\\ParamTag', 'extraLink' => '\\phpDocumentor\\Reflection\\DocBlock\\Tag\\ParamTag'];
foreach ($mapping as $suffix => $class) {
$tagName = Doc::TAG_PREFIX . $suffix;
Tag::registerTagHandler($tagName, $class);
}
}
}
示例3: boot
/**
* Perform post-registration booting of services.
*
* @return void
*/
public function boot()
{
// Registering custom tags
Tag::registerTagHandler('apiParam', '\\phpDocumentor\\Reflection\\DocBlock\\Tag\\ParamTag');
// Set router
RouteResolver::setRouter(app()->make('router'));
// use this if your package needs a config file
// $this->publishes([
// __DIR__.'/config/config.php' => config_path('skeleton.php'),
// ]);
// use the vendor configuration file as fallback
// $this->mergeConfigFrom(
// __DIR__.'/config/config.php', 'skeleton'
// );
}
示例4: testIncompatibleTagHandlerRegistration
/**
* @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler
*
* @return void
*/
public function testIncompatibleTagHandlerRegistration()
{
$currentHandler = __NAMESPACE__ . '\\Tag\\VarTag';
$tagPreReg = Tag::createInstance('@var mixed');
$this->assertInstanceOf($currentHandler, $tagPreReg);
$this->assertInstanceOf(__NAMESPACE__ . '\\Tag', $tagPreReg);
$this->assertFalse(Tag::registerTagHandler('var', __NAMESPACE__ . '\\TagTest'));
$tagPostReg = Tag::createInstance('@var mixed');
$this->assertInstanceOf($currentHandler, $tagPostReg);
$this->assertInstanceOf(__NAMESPACE__ . '\\Tag', $tagPostReg);
}