Skip to content

Commit

Permalink
Zend\Server cleanup
Browse files Browse the repository at this point in the history
- Renamed Reflection\Reflection to Reflection
- Updated all dependent code and tests
  • Loading branch information
weierophinney committed Jul 6, 2010
1 parent 65ef62d commit b2c19c5
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions library/Zend/AMF/Adobe/Introspector.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @uses Zend\AMF\Parser\TypeLoader
* @uses Zend\Loader
* @uses Zend\Reflection\ReflectionClass
* @uses Zend\Server\Reflection\Reflection
* @uses Zend\Server\Reflection
* @package Zend_Amf
* @subpackage Adobe
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
Expand Down Expand Up @@ -101,7 +101,7 @@ public function introspect($serviceClass, $options = array())
$this->_types = $this->_xml->createElement('types');
$this->_ops = $this->_xml->createElement('operations');

$r = \Zend\Server\Reflection\Reflection::reflectClass($serviceClass);
$r = \Zend\Server\Reflection::reflectClass($serviceClass);
$this->_addService($r, $this->_ops);

$serv->appendChild($this->_types);
Expand Down
6 changes: 3 additions & 3 deletions library/Zend/AMF/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* @uses Zend\Authentication\AuthenticationService
* @uses Zend\Loader\PluginLoader
* @uses Zend\Server\Server
* @uses Zend\Server\Reflection\Reflection
* @uses Zend\Server\Reflection
* @uses Zend\Session\Manager
* @uses Zend\Session\Container
* @package Zend_Amf
Expand Down Expand Up @@ -758,7 +758,7 @@ public function setClass($class, $namespace = '', $argv = null)

$this->_classAllowed[is_object($class) ? get_class($class) : $class] = true;

$this->_methods[] = Reflection\Reflection::reflectClass($class, $argv, $namespace);
$this->_methods[] = Reflection::reflectClass($class, $argv, $namespace);
$this->_buildDispatchTable();

return $this;
Expand Down Expand Up @@ -792,7 +792,7 @@ public function addFunction($function, $namespace = '')
if (!is_string($func) || !function_exists($func)) {
throw new Exception('Unable to attach function');
}
$this->_methods[] = Reflection\Reflection::reflectFunction($func, $argv, $namespace);
$this->_methods[] = Reflection::reflectFunction($func, $argv, $namespace);
}

$this->_buildDispatchTable();
Expand Down
8 changes: 4 additions & 4 deletions library/Zend/JSON/Server/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @uses Zend\JSON\Server\Response\HTTP
* @uses Zend\JSON\Server\SMD
* @uses Zend\Server\AbstractServer
* @uses Zend\Server\Reflection\Reflection
* @uses Zend\Server\Reflection
* @category Zend
* @package Zend_JSON
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
Expand Down Expand Up @@ -112,11 +112,11 @@ public function addFunction($function, $namespace = '')
}

if (is_string($function)) {
$method = Reflection\Reflection::reflectFunction($function, $argv, $namespace);
$method = Reflection::reflectFunction($function, $argv, $namespace);
} else {
$class = array_shift($function);
$action = array_shift($function);
$reflection = Reflection\Reflection::reflectClass($class, $argv, $namespace);
$reflection = Reflection::reflectClass($class, $argv, $namespace);
$methods = $reflection->getMethods();
$found = false;
foreach ($methods as $method) {
Expand Down Expand Up @@ -153,7 +153,7 @@ public function setClass($class, $namespace = '', $argv = null)
$argv = array_slice($argv, 3);
}

$reflection = Reflection\Reflection::reflectClass($class, $argv, $namespace);
$reflection = Reflection::reflectClass($class, $argv, $namespace);

foreach ($reflection->getMethods() as $method) {
$definition = $this->_buildSignature($method, $class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/**
* @namespace
*/
namespace Zend\Server\Reflection;
namespace Zend\Server;

/**
* Reflection for determining method signatures to use with server classes
Expand Down Expand Up @@ -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);
}

/**
Expand All @@ -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);
}
}
2 changes: 1 addition & 1 deletion library/Zend/Server/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions library/Zend/Soap/AutoDiscover.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
* @uses \Zend\Server\AbstractServer
* @uses \Zend\Server\Server
* @uses \Zend\Server\Reflection\Reflection
* @uses \Zend\Server\Reflection
* @uses \Zend\Soap\AutoDiscover\Exception
* @uses \Zend\Soap\WSDL
* @uses \Zend\URI\URI
Expand All @@ -49,7 +49,7 @@ class AutoDiscover implements \Zend\Server\Server
protected $_wsdl = null;

/**
* @var \Zend\Server\Reflection\Reflection
* @var \Zend\Server\Reflection
*/
protected $_reflection = null;

Expand Down Expand Up @@ -100,7 +100,7 @@ class AutoDiscover implements \Zend\Server\Server
*/
public function __construct($strategy = true, $uri=null, $wsdlClass=null)
{
$this->_reflection = new \Zend\Server\Reflection\Reflection();
$this->_reflection = new \Zend\Server\Reflection();
$this->setComplexTypeStrategy($strategy);

if($uri !== null) {
Expand Down
6 changes: 3 additions & 3 deletions library/Zend/XmlRpc/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
* @uses ReflectionClass
* @uses Zend\Server\AbstractServer
* @uses Zend\Server\Definition
* @uses Zend\Server\Reflection\Reflection
* @uses Zend\Server\Reflection
* @uses Zend\Server\Reflection\AbstractFunction
* @uses Zend\Server\Reflection\ReflectionMethod
* @uses Zend\XmlRpc\Request
Expand Down Expand Up @@ -211,7 +211,7 @@ public function addFunction($function, $namespace = '')
if (!is_string($func) || !function_exists($func)) {
throw new Server\Exception('Unable to attach function; invalid', 611);
}
$reflection = Reflection\Reflection::reflectFunction($func, $argv, $namespace);
$reflection = Reflection::reflectFunction($func, $argv, $namespace);
$this->_buildSignature($reflection);
}
}
Expand Down Expand Up @@ -245,7 +245,7 @@ public function setClass($class, $namespace = '', $argv = null)
$argv = array_slice($argv, 2);
}

$dispatchable = Reflection\Reflection::reflectClass($class, $argv, $namespace);
$dispatchable = Reflection::reflectClass($class, $argv, $namespace);
foreach ($dispatchable->getMethods() as $reflection) {
$this->_buildSignature($reflection, $class);
}
Expand Down
6 changes: 3 additions & 3 deletions working/PHPNamespacer-MappedClasses.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11875,10 +11875,10 @@
<mappedClass>
<originalRelativeFilePath>Zend/Server/Reflection.php</originalRelativeFilePath>
<originalClassName>Zend_Server_Reflection</originalClassName>
<newRelativeFilePath>Zend/Server/Reflection/Reflection.php</newRelativeFilePath>
<newNamespace>Zend\Server\Reflection</newNamespace>
<newRelativeFilePath>Zend/Server/Reflection.php</newRelativeFilePath>
<newNamespace>Zend\Server</newNamespace>
<newClassName>Reflection</newClassName>
<newFullyQualifiedName>Zend\Server\Reflection\Reflection</newFullyQualifiedName>
<newFullyQualifiedName>Zend\Server\Reflection</newFullyQualifiedName>
</mappedClass>
<mappedClass>
<originalRelativeFilePath>Zend/Service/Abstract.php</originalRelativeFilePath>
Expand Down

0 comments on commit b2c19c5

Please sign in to comment.