From: Andrey Kutejko Date: Sun, 28 Jul 2013 11:35:32 +0000 (+0300) Subject: introduce IPF_Server_Exception class X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=60086cc435769be9e9eaaa36687238dd04ef262f;p=ipf-xmlrpc.git introduce IPF_Server_Exception class --- diff --git a/server/exception.php b/server/exception.php new file mode 100644 index 0000000..dd3ec0b --- /dev/null +++ b/server/exception.php @@ -0,0 +1,6 @@ +_reflection, $method)) { return call_user_func_array(array($this->_reflection, $method), $args); } - throw new IPF_Exception('Invalid reflection method'); + throw new IPF_Server_Exception('Invalid reflection method'); } public function __get($key) @@ -64,7 +64,7 @@ class IPF_Server_Reflection_Class } if (!is_string($namespace) || !preg_match('/[a-z0-9_\.]+/i', $namespace)) { - throw new IPF_Exception('Invalid namespace'); + throw new IPF_Server_Exception('Invalid namespace'); } $this->_namespace = $namespace; diff --git a/server/reflection/function/abstract.php b/server/reflection/function/abstract.php index f65405d..f122e4f 100644 --- a/server/reflection/function/abstract.php +++ b/server/reflection/function/abstract.php @@ -25,7 +25,7 @@ class IPF_Server_Reflection_Function_Abstract // testing here. if ((!$r instanceof ReflectionFunction) && (!$r instanceof ReflectionMethod)) { - throw new IPF_Exception('Invalid reflection class'); + throw new IPF_Server_Exception('Invalid reflection class'); } $this->_reflection = $r; @@ -221,7 +221,7 @@ class IPF_Server_Reflection_Function_Abstract return call_user_func_array(array($this->_reflection, $method), $args); } - throw new IPF_Exception('Invalid reflection method ("' .$method. '")'); + throw new IPF_Server_Exception('Invalid reflection method ("' .$method. '")'); } public function __get($key) @@ -246,7 +246,7 @@ class IPF_Server_Reflection_Function_Abstract } if (!is_string($namespace) || !preg_match('/[a-z0-9_\.]+/i', $namespace)) { - throw new IPF_Exception('Invalid namespace'); + throw new IPF_Server_Exception('Invalid namespace'); } $this->_namespace = $namespace; @@ -260,7 +260,7 @@ class IPF_Server_Reflection_Function_Abstract public function setDescription($string) { if (!is_string($string)) { - throw new IPF_Exception('Invalid description'); + throw new IPF_Server_Exception('Invalid description'); } $this->_description = $string; diff --git a/server/reflection/parameter.php b/server/reflection/parameter.php index d043314..9fe2f06 100644 --- a/server/reflection/parameter.php +++ b/server/reflection/parameter.php @@ -19,7 +19,7 @@ class IPF_Server_Reflection_Parameter if (method_exists($this->_reflection, $method)) { return call_user_func_array(array($this->_reflection, $method), $args); } - throw new IPF_Exception('Invalid reflection method'); + throw new IPF_Server_Exception('Invalid reflection method'); } public function getType() @@ -30,7 +30,7 @@ class IPF_Server_Reflection_Parameter public function setType($type) { if (!is_string($type) && (null !== $type)) { - throw new IPF_Exception('Invalid parameter type'); + throw new IPF_Server_Exception('Invalid parameter type'); } $this->_type = $type; } @@ -43,7 +43,7 @@ class IPF_Server_Reflection_Parameter public function setDescription($description) { if (!is_string($description) && (null !== $description)) { - throw new IPF_Exception('Invalid parameter description'); + throw new IPF_Server_Exception('Invalid parameter description'); } $this->_description = $description; } diff --git a/server/reflection/prototype.php b/server/reflection/prototype.php index c34375d..2326791 100644 --- a/server/reflection/prototype.php +++ b/server/reflection/prototype.php @@ -7,13 +7,13 @@ class IPF_Server_Reflection_Prototype $this->_return = $return; if (!is_array($params) && (null !== $params)) { - throw new IPF_Exception('Invalid parameters'); + throw new IPF_Server_Exception('Invalid parameters'); } if (is_array($params)) { foreach ($params as $param) { if (!$param instanceof IPF_Server_Reflection_Parameter) { - throw new IPF_Exception('One or more params are invalid'); + throw new IPF_Server_Exception('One or more params are invalid'); } } } diff --git a/server/reflection/returnvalue.php b/server/reflection/returnvalue.php index c33fb2c..34010cc 100644 --- a/server/reflection/returnvalue.php +++ b/server/reflection/returnvalue.php @@ -19,7 +19,7 @@ class IPF_Server_Reflection_ReturnValue public function setType($type) { if (!is_string($type) && (null !== $type)) { - throw new IPF_Exception('Invalid parameter type'); + throw new IPF_Server_Exception('Invalid parameter type'); } $this->_type = $type; } @@ -32,7 +32,7 @@ class IPF_Server_Reflection_ReturnValue public function setDescription($description) { if (!is_string($description) && (null !== $description)) { - throw new IPF_Exception('Invalid parameter description'); + throw new IPF_Server_Exception('Invalid parameter description'); } $this->_description = $description; }