3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Code\Reflection\DocBlock\Tag
;
12 class ReturnTag
implements TagInterface
, PhpDocTypedTagInterface
17 protected $types = array();
22 protected $description = null;
27 public function getName()
33 * @param string $tagDocBlockLine
36 public function initialize($tagDocBlockLine)
39 if (!preg_match('#((?:[\w|\\\]+(?:\[\])*\|?)+)(?:\s+(.*))?#s', $tagDocBlockLine, $matches)) {
43 $this->types
= explode('|', $matches[1]);
45 if (isset($matches[2])) {
46 $this->description
= trim(preg_replace('#\s+#', ' ', $matches[2]));
52 * @deprecated 2.0.4 use getTypes instead
54 public function getType()
56 if (empty($this->types
)) {
60 return $this->types
[0];
63 public function getTypes()
71 public function getDescription()
73 return $this->description
;