]> git.andy128k.dev Git - ipf-xmlrpc.git/commitdiff
introduce IPF_Server_Exception class
authorAndrey Kutejko <andy128k@gmail.com>
Sun, 28 Jul 2013 11:35:32 +0000 (14:35 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Sun, 28 Jul 2013 11:35:32 +0000 (14:35 +0300)
server/exception.php [new file with mode: 0644]
server/reflection.php
server/reflection/class.php
server/reflection/function/abstract.php
server/reflection/parameter.php
server/reflection/prototype.php
server/reflection/returnvalue.php

diff --git a/server/exception.php b/server/exception.php
new file mode 100644 (file)
index 0000000..dd3ec0b
--- /dev/null
@@ -0,0 +1,6 @@
+<?php
+
+class IPF_Server_Exception extends Exception
+{
+}
+
index f6f98f23e171c7900390ef4ad3a598a0f2dfd214..ce3911806ebcd8ebcf7f165f62a28dfc0bc82860 100644 (file)
@@ -9,11 +9,11 @@ class IPF_Server_Reflection
         } elseif (class_exists($class)) {
             $reflection = new ReflectionClass($class);
         } else {
-            throw new IPF_Exception('Invalid class or object passed to attachClass()');
+            throw new IPF_Server_Exception('Invalid class or object passed to attachClass()');
         }
 
         if ($argv && !is_array($argv)) {
-            throw new IPF_Exception('Invalid argv argument passed to reflectClass');
+            throw new IPF_Server_Exception('Invalid argv argument passed to reflectClass');
         }
         return new IPF_Server_Reflection_Class($reflection, $namespace, $argv);
     }
@@ -21,10 +21,10 @@ class IPF_Server_Reflection
     public static function reflectFunction($function, $argv = false, $namespace = '')
     {
         if (!is_string($function) || !function_exists($function)) {
-            throw new IPF_Exception('Invalid function "' . $function . '" passed to reflectFunction');
+            throw new IPF_Server_Exception('Invalid function "' . $function . '" passed to reflectFunction');
         }
         if ($argv && !is_array($argv)) {
-            throw new IPF_Exception('Invalid argv argument passed to reflectClass');
+            throw new IPF_Server_Exception('Invalid argv argument passed to reflectClass');
         }
         return new IPF_Server_Reflection_Function(new ReflectionFunction($function), $namespace, $argv);
     }
index d082be552faa8bae49bdeb32a49f2114a3a45dae..7160925c689bf30a34a6f1e8f3ff4693b160aa17 100644 (file)
@@ -29,7 +29,7 @@ class IPF_Server_Reflection_Class
         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 __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;
index f65405db3ca1a30b2b7c93255cb9b82b1fda3c06..f122e4faf1480ccd772ce10eaba5edb1084d23c5 100644 (file)
@@ -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;
index d04331463e4d406cc988e6f821bc00511f531af8..9fe2f061cdbccfdbc4e32157f9effc6c8a7992b9 100644 (file)
@@ -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;
     }
index c34375dfec368c24b8fc51152a8ac73cdb099490..23267911e08ef14cd0890283ca22f27219b929d2 100644 (file)
@@ -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');
                 }
             }
         }
index c33fb2c4dc09486ccbc62355fca65ed7a1b950c4..34010ccc70ce1657ee4871363d8bece9768730ea 100644 (file)
@@ -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;
     }