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 / ParameterReflection.php
blob4b8b067f3143cf4379694415c1e79ce9ce6d38e7
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;
12 use ReflectionParameter;
14 class ParameterReflection extends ReflectionParameter implements ReflectionInterface
16 /**
17 * @var bool
19 protected $isFromMethod = false;
21 /**
22 * Get declaring class reflection object
24 * @return ClassReflection
26 public function getDeclaringClass()
28 $phpReflection = parent::getDeclaringClass();
29 $zendReflection = new ClassReflection($phpReflection->getName());
30 unset($phpReflection);
32 return $zendReflection;
35 /**
36 * Get class reflection object
38 * @return ClassReflection
40 public function getClass()
42 $phpReflection = parent::getClass();
43 if ($phpReflection == null) {
44 return null;
47 $zendReflection = new ClassReflection($phpReflection->getName());
48 unset($phpReflection);
50 return $zendReflection;
53 /**
54 * Get declaring function reflection object
56 * @return FunctionReflection|MethodReflection
58 public function getDeclaringFunction()
60 $phpReflection = parent::getDeclaringFunction();
61 if ($phpReflection instanceof \ReflectionMethod) {
62 $zendReflection = new MethodReflection($this->getDeclaringClass()->getName(), $phpReflection->getName());
63 } else {
64 $zendReflection = new FunctionReflection($phpReflection->getName());
66 unset($phpReflection);
68 return $zendReflection;
71 /**
72 * Get parameter type
74 * @return string
76 public function getType()
78 if ($this->isArray()) {
79 return 'array';
80 } elseif (method_exists($this, 'isCallable') && $this->isCallable()) {
81 return 'callable';
84 if (($class = $this->getClass()) instanceof \ReflectionClass) {
85 return $class->getName();
88 $docBlock = $this->getDeclaringFunction()->getDocBlock();
89 if (!$docBlock instanceof DocBlockReflection) {
90 return null;
93 $params = $docBlock->getTags('param');
94 if (isset($params[$this->getPosition()])) {
95 return $params[$this->getPosition()]->getType();
98 return null;
101 public function toString()
103 return parent::__toString();
106 public function __toString()
108 return parent::__toString();