Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Code / Reflection / DocBlock / Tag / MethodTag.php
blobd07d4950d6f25ebf709674a48077e182d4a17b98
1 <?php
2 /**
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
8 */
10 namespace Zend\Code\Reflection\DocBlock\Tag;
12 class MethodTag implements TagInterface, PhpDocTypedTagInterface
14 /**
15 * Return value type
17 * @var array
19 protected $types = array();
21 /**
22 * @var string
24 protected $methodName = null;
26 /**
27 * @var string
29 protected $description = null;
31 /**
32 * Is static method
34 * @var bool
36 protected $isStatic = false;
38 /**
39 * @return string
41 public function getName()
43 return 'method';
46 /**
47 * Initializer
49 * @param string $tagDocblockLine
51 public function initialize($tagDocblockLine)
53 $match = array();
55 if (!preg_match('#^(static[\s]+)?(.+[\s]+)?(.+\(\))[\s]*(.*)$#m', $tagDocblockLine, $match)) {
56 return;
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];
74 /**
75 * Get return value type
77 * @return null|string
78 * @deprecated 2.0.4 use getTypes instead
80 public function getReturnType()
82 if (empty($this->types)) {
83 return null;
86 return $this->types[0];
89 public function getTypes()
91 return $this->types;
94 /**
95 * @return string
97 public function getMethodName()
99 return $this->methodName;
103 * @return null|string
105 public function getDescription()
107 return $this->description;
111 * Is method static
113 * @return bool
115 public function isStatic()
117 return $this->isStatic;
120 public function __toString()
122 return 'DocBlock Tag [ * @' . $this->getName() . ' ]' . PHP_EOL;