Source of file GenericTag.php
Size: 1,794 Bytes - Last Modified: 2014-03-12T23:21:18+01:00
/home/theseer/Downloads/ZendFramework-2.3.0/library/Zend/Code/Generator/DocBlock/Tag/GenericTag.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 | <?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Code\Generator\DocBlock\Tag; use Zend\Code\Generator\AbstractGenerator; use Zend\Code\Generic\Prototype\PrototypeGenericInterface; class GenericTag extends AbstractGenerator implements TagInterface, PrototypeGenericInterface { /** * @var string */ protected $name = null; /** * @var string */ protected $content = null; /** * @param string $name * @param string $content */ public function __construct($name = null, $content = null) { if (!empty($name)) { $this->setName($name); } if (!empty($content)) { $this->setContent($content); } } /** * @param string $name * @return GenericTag */ public function setName($name) { $this->name = ltrim($name, '@'); return $this; } /** * @return string */ public function getName() { return $this->name; } /** * @param string $content * @return GenericTag */ public function setContent($content) { $this->content = $content; return $this; } /** * @return string */ public function getContent() { return $this->content; } /** * @return string */ public function generate() { $output = '@' . $this->name . ((!empty($this->content)) ? ' ' . $this->content : ''); return $output; } } |