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 MethodTag
implements TagInterface
, PhpDocTypedTagInterface
19 protected $types = array();
24 protected $methodName = null;
29 protected $description = null;
36 protected $isStatic = false;
41 public function getName()
49 * @param string $tagDocblockLine
51 public function initialize($tagDocblockLine)
55 if (!preg_match('#^(static[\s]+)?(.+[\s]+)?(.+\(\))[\s]*(.*)$#m', $tagDocblockLine, $match)) {
59 if ($match[1] !== '') {
60 $this->isStatic
= true;
63 if ($match[2] !== '') {
64 $this->types
= explode('|', rtrim($match[2]));
67 $this->methodName
= $match[3];
69 if ($match[4] !== '') {
70 $this->description
= $match[4];
75 * Get return value type
78 * @deprecated 2.0.4 use getTypes instead
80 public function getReturnType()
82 if (empty($this->types
)) {
86 return $this->types
[0];
89 public function getTypes()
97 public function getMethodName()
99 return $this->methodName
;
103 * @return null|string
105 public function getDescription()
107 return $this->description
;
115 public function isStatic()
117 return $this->isStatic
;
120 public function __toString()
122 return 'DocBlock Tag [ * @' . $this->getName() . ' ]' . PHP_EOL
;