當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。