From 929991c2f174c6c98ecb8ff4301e65a234a1467d Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Sat, 3 Jul 2010 23:40:03 -0400 Subject: [PATCH 1/2] Zend\Server cleanup - Renamed Zend\Server\ServerInterface to simply Zend\Server\Server - Updated code and tests to reflect the above --- src/AbstractServer.php | 4 ++-- src/Cache.php | 8 ++++---- src/{ServerInterface.php => Server.php} | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) rename src/{ServerInterface.php => Server.php} (99%) diff --git a/src/AbstractServer.php b/src/AbstractServer.php index 522fba86..35e24e5e 100644 --- a/src/AbstractServer.php +++ b/src/AbstractServer.php @@ -29,7 +29,7 @@ * @uses ReflectionClass * @uses \Zend\Server\Definition * @uses \Zend\Server\Exception - * @uses \Zend\Server\ServerInterface + * @uses \Zend\Server\Server * @uses \Zend\Server\Method\Callback * @uses \Zend\Server\Method\Definition * @uses \Zend\Server\Method\Parameter @@ -40,7 +40,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ -abstract class AbstractServer implements ServerInterface +abstract class AbstractServer implements Server { /** * @deprecated diff --git a/src/Cache.php b/src/Cache.php index ce63e75a..99ba7964 100644 --- a/src/Cache.php +++ b/src/Cache.php @@ -50,10 +50,10 @@ class Cache * on success. * * @param string $filename - * @param \Zend\Server\ServerInterface $server + * @param \Zend\Server\Server $server * @return bool */ - public static function save($filename, ServerInterface $server) + public static function save($filename, Server $server) { if (!is_string($filename) || (!file_exists($filename) && !is_writable(dirname($filename)))) @@ -109,10 +109,10 @@ public static function save($filename, ServerInterface $server) * * * @param string $filename - * @param \Zend\Server\ServerInterface $server + * @param \Zend\Server\Server $server * @return bool */ - public static function get($filename, ServerInterface $server) + public static function get($filename, Server $server) { if (!is_string($filename) || !file_exists($filename) diff --git a/src/ServerInterface.php b/src/Server.php similarity index 99% rename from src/ServerInterface.php rename to src/Server.php index 5a188c5a..05b2ffdb 100644 --- a/src/ServerInterface.php +++ b/src/Server.php @@ -32,7 +32,7 @@ * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -interface ServerInterface +interface Server { /** * Attach a function as a server method From 573f8ae0ed97f825d7880e563a1b327b0d9612f6 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Tue, 6 Jul 2010 09:04:48 -0400 Subject: [PATCH 2/2] Zend\Server cleanup - Renamed Reflection\Reflection to Reflection - Updated all dependent code and tests --- src/{Reflection => }/Reflection.php | 14 +++++++------- src/Server.php | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) rename src/{Reflection => }/Reflection.php (85%) diff --git a/src/Reflection/Reflection.php b/src/Reflection.php similarity index 85% rename from src/Reflection/Reflection.php rename to src/Reflection.php index 7ef733c2..3f14af79 100644 --- a/src/Reflection/Reflection.php +++ b/src/Reflection.php @@ -23,7 +23,7 @@ /** * @namespace */ -namespace Zend\Server\Reflection; +namespace Zend\Server; /** * Reflection for determining method signatures to use with server classes @@ -65,14 +65,14 @@ public static function reflectClass($class, $argv = false, $namespace = '') } elseif (class_exists($class)) { $reflection = new \ReflectionClass($class); } else { - throw new Exception('Invalid class or object passed to attachClass()'); + throw new Reflection\Exception('Invalid class or object passed to attachClass()'); } if ($argv && !is_array($argv)) { - throw new Exception('Invalid argv argument passed to reflectClass'); + throw new Reflection\Exception('Invalid argv argument passed to reflectClass'); } - return new ReflectionClass($reflection, $namespace, $argv); + return new Reflection\ReflectionClass($reflection, $namespace, $argv); } /** @@ -95,14 +95,14 @@ public static function reflectClass($class, $argv = false, $namespace = '') public static function reflectFunction($function, $argv = false, $namespace = '') { if (!is_string($function) || !function_exists($function)) { - throw new Exception('Invalid function "' . $function . '" passed to reflectFunction'); + throw new Reflection\Exception('Invalid function "' . $function . '" passed to reflectFunction'); } if ($argv && !is_array($argv)) { - throw new Exception('Invalid argv argument passed to reflectClass'); + throw new Reflection\Exception('Invalid argv argument passed to reflectClass'); } - return new ReflectionFunction(new \ReflectionFunction($function), $namespace, $argv); + return new Reflection\ReflectionFunction(new \ReflectionFunction($function), $namespace, $argv); } } diff --git a/src/Server.php b/src/Server.php index 05b2ffdb..49e8e054 100644 --- a/src/Server.php +++ b/src/Server.php @@ -94,7 +94,7 @@ public function handle($request = false); * Return a server definition array * * Returns a server definition array as created using - * {@link * \Zend\Server\Reflection\Reflection}. Can be used for server introspection, + * {@link * \Zend\Server\Reflection}. Can be used for server introspection, * documentation, or persistence. * * @access public