TheSeer\phpDox\DocBlock\DocBlock::getElementByName PHP Method

getElementByName() public method

public getElementByName ( $name )
    public function getElementByName($name)
    {
        if (!isset($this->elements[$name])) {
            throw new DocBlockException("No element with name '{$name}'", DocBlockException::NotFound);
        }
        return $this->elements[$name];
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * @covers TheSeer\phpDox\DocBlock\DocBlock::getElementByName
  */
 public function testElementCanBeRetreived()
 {
     $this->docBlock->appendElement($this->element);
     $this->assertEquals($this->element, $this->docBlock->getElementByName('stub'));
 }