|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00033 class Zend_Server_Reflection_Parameter 00034 { 00038 protected $_reflection; 00039 00044 protected $_position; 00045 00050 protected $_type; 00051 00056 protected $_description; 00057 00065 public function __construct(ReflectionParameter $r, $type = 'mixed', $description = '') 00066 { 00067 $this->_reflection = $r; 00068 $this->setType($type); 00069 $this->setDescription($description); 00070 } 00071 00079 public function __call($method, $args) 00080 { 00081 if (method_exists($this->_reflection, $method)) { 00082 return call_user_func_array(array($this->_reflection, $method), $args); 00083 } 00084 00085 require_once 'Zend/Server/Reflection/Exception.php'; 00086 throw new Zend_Server_Reflection_Exception('Invalid reflection method'); 00087 } 00088 00094 public function getType() 00095 { 00096 return $this->_type; 00097 } 00098 00105 public function setType($type) 00106 { 00107 if (!is_string($type) && (null !== $type)) { 00108 require_once 'Zend/Server/Reflection/Exception.php'; 00109 throw new Zend_Server_Reflection_Exception('Invalid parameter type'); 00110 } 00111 00112 $this->_type = $type; 00113 } 00114 00120 public function getDescription() 00121 { 00122 return $this->_description; 00123 } 00124 00131 public function setDescription($description) 00132 { 00133 if (!is_string($description) && (null !== $description)) { 00134 require_once 'Zend/Server/Reflection/Exception.php'; 00135 throw new Zend_Server_Reflection_Exception('Invalid parameter description'); 00136 } 00137 00138 $this->_description = $description; 00139 } 00140 00147 public function setPosition($index) 00148 { 00149 $this->_position = (int) $index; 00150 } 00151 00157 public function getPosition() 00158 { 00159 return $this->_position; 00160 } 00161 }