当前位置: 首页>>代码示例>>PHP>>正文


PHP DocBlock::getLocation方法代码示例

本文整理汇总了PHP中phpDocumentor\Reflection\DocBlock::getLocation方法的典型用法代码示例。如果您正苦于以下问题:PHP DocBlock::getLocation方法的具体用法?PHP DocBlock::getLocation怎么用?PHP DocBlock::getLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在phpDocumentor\Reflection\DocBlock的用法示例。


在下文中一共展示了DocBlock::getLocation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Constructor
  *
  * @param string             $name     Name of the "entity"
  * @param DocBlock|null      $docblock Docblock
  * @param BaseReflector|null $source   Source Element.
  */
 public function __construct($name, $docblock = null, $source = null)
 {
     $this->entityName = $name;
     $this->lineNumber = $docblock ? $docblock->getLocation()->getLineNumber() : $source->getLineNumber();
     $this->docblock = $docblock;
     $this->source = $source;
 }
开发者ID:michaelyin1,项目名称:Modern-Toolkit,代码行数:14,代码来源:ValidatorAbstract.php

示例2: __construct

 /**
  * Constructor
  *
  * @param \phpDocumentor\Plugin\Plugin            $plugin     Plugin to which this
  *     validator belongs.
  * @param string                                  $name       Name of the "entity"
  * @param \phpDocumentor\Reflection\DocBlock|null $docblock   Docblock
  * @param \phpDocumentor\Reflection\BaseReflector|null  $source     Source Element.
  */
 public function __construct($plugin, $name, $docblock = null, $source = null)
 {
     $this->entityName = $name;
     $this->lineNumber = $docblock ? $docblock->getLocation()->getLineNumber() : $source->getLineNumber();
     $this->docblock = $docblock;
     $this->source = $source;
     parent::__construct($plugin->getEventDispatcher(), $plugin->getConfiguration(), $plugin->getTranslator());
 }
开发者ID:laiello,项目名称:lion-framework,代码行数:17,代码来源:ValidatorAbstract.php

示例3: testConstruct

    /**
     * @covers \phpDocumentor\Reflection\DocBlock
     * 
     * @return void
     */
    public function testConstruct()
    {
        $fixture = <<<DOCBLOCK
/**
 * This is a short description
 *
 * This is a long description
 *
 * @see \\MyClass
 * @return void
 */
DOCBLOCK;
        $object = new DocBlock($fixture, new Context('\\MyNamespace', array('PHPDoc' => '\\phpDocumentor')), new Location(2));
        $this->assertEquals('This is a short description', $object->getShortDescription());
        $this->assertEquals('This is a long description', $object->getLongDescription()->getContents());
        $this->assertCount(2, $object->getTags());
        $this->assertTrue($object->hasTag('see'));
        $this->assertTrue($object->hasTag('return'));
        $this->assertFalse($object->hasTag('material_unit'));
        $this->assertSame('MyNamespace', $object->getContext()->getNamespace());
        $this->assertSame(array('PHPDoc' => '\\phpDocumentor'), $object->getContext()->getNamespaceAliases());
        $this->assertSame(2, $object->getLocation()->getLineNumber());
    }
开发者ID:ecmattos,项目名称:codemat,代码行数:28,代码来源:DocBlockTest.php

示例4: testDocBlockKnowsAtWhichLineItIs

 /**
  * @covers ::__construct
  * @covers ::getLocation
  *
  * @uses \phpDocumentor\Reflection\DocBlock\Description
  * @uses \phpDocumentor\Reflection\Location
  */
 public function testDocBlockKnowsAtWhichLineItIs()
 {
     $location = new Location(10);
     $fixture = new DocBlock('', null, [], null, $location);
     $this->assertSame($location, $fixture->getLocation());
 }
开发者ID:jaapio,项目名称:ReflectionDocBlock,代码行数:13,代码来源:DocBlockTest.php


注:本文中的phpDocumentor\Reflection\DocBlock::getLocation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。