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 / Server / Reflection / ReflectionParameter.php
blobc5f8fb31ca9633256b4f1457f55a9c304a3c35d9
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\Server\Reflection;
12 /**
13 * Parameter Reflection
15 * Decorates a ReflectionParameter to allow setting the parameter type
17 class ReflectionParameter
19 /**
20 * @var \ReflectionParameter
22 protected $reflection;
24 /**
25 * Parameter position
26 * @var int
28 protected $position;
30 /**
31 * Parameter type
32 * @var string
34 protected $type;
36 /**
37 * Parameter description
38 * @var string
40 protected $description;
42 /**
43 * Constructor
45 * @param \ReflectionParameter $r
46 * @param string $type Parameter type
47 * @param string $description Parameter description
49 public function __construct(\ReflectionParameter $r, $type = 'mixed', $description = '')
51 $this->reflection = $r;
52 $this->setType($type);
53 $this->setDescription($description);
56 /**
57 * Proxy reflection calls
59 * @param string $method
60 * @param array $args
61 * @throws Exception\BadMethodCallException
62 * @return mixed
64 public function __call($method, $args)
66 if (method_exists($this->reflection, $method)) {
67 return call_user_func_array(array($this->reflection, $method), $args);
70 throw new Exception\BadMethodCallException('Invalid reflection method');
73 /**
74 * Retrieve parameter type
76 * @return string
78 public function getType()
80 return $this->type;
83 /**
84 * Set parameter type
86 * @param string|null $type
87 * @throws Exception\InvalidArgumentException
88 * @return void
90 public function setType($type)
92 if (!is_string($type) && (null !== $type)) {
93 throw new Exception\InvalidArgumentException('Invalid parameter type');
96 $this->type = $type;
99 /**
100 * Retrieve parameter description
102 * @return string
104 public function getDescription()
106 return $this->description;
110 * Set parameter description
112 * @param string|null $description
113 * @throws Exception\InvalidArgumentException
114 * @return void
116 public function setDescription($description)
118 if (!is_string($description) && (null !== $description)) {
119 throw new Exception\InvalidArgumentException('Invalid parameter description');
122 $this->description = $description;
126 * Set parameter position
128 * @param int $index
129 * @return void
131 public function setPosition($index)
133 $this->position = (int) $index;
137 * Return parameter position
139 * @return int
141 public function getPosition()
143 return $this->position;