Zend Framework

Zend_XmlRpc_Server should implement Zend_Server_Interface

Details

  • Type: Patch Patch
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.0.1
  • Fix Version/s: 1.6.0
  • Component/s: Zend_XmlRpc_Server
  • Labels:
    None
  • Fix Version Priority:
    Must Have

Description

Changing "public function handle(Zend_XmlRpc_Request $request = null)"
to "public function handle($request = null)" is not critical, because type checking is also done by the following setRequest call. The other changes also don't seem to cause problems.

Patch follows:

Index: Zend/XmlRpc/Server.php
===================================================================
--- Zend/XmlRpc/Server.php      (revision 6103)
+++ Zend/XmlRpc/Server.php      (working copy)
@@ -112,7 +112,7 @@
  * @copyright  Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://www.zend.com/license/framework/1_0.txt Zend Framework License version 1.0
  */
-class Zend_XmlRpc_Server
+class Zend_XmlRpc_Server implements Zend_Server_Interface
 {
     /**
      * Character encoding
@@ -368,7 +368,7 @@
      * @param mixed $class
      * @return void
      */
-    public function setPersistence($class = null)
+    public function setPersistence($class)
     {
     }
 
@@ -447,7 +447,7 @@
      * @param int $code
      * @return Zend_XmlRpc_Server_Fault
      */
-    public function fault($fault, $code = 404)
+    public function fault($fault = null, $code = 404)
     {
         if (!$fault instanceof Exception) {
             $fault = (string) $fault;
@@ -544,7 +544,7 @@
      * @param Zend_XmlRpc_Request $request Optional
      * @return Zend_XmlRpc_Response|Zend_XmlRpc_Fault
      */
-    public function handle(Zend_XmlRpc_Request $request = null)
+    public function handle($request = null)
     {
         // Get request
         if ((null === $request) && (null === ($request = $this->getRequest()))) {
@@ -726,3 +726,4 @@
         return $responses;
     }
 }

Activity

Hide
Thomas Weidner added a comment -

Assigned to Matthew

Show
Thomas Weidner added a comment - Assigned to Matthew
Hide
Matthew Weier O'Phinney added a comment -

I was against Zend_Server_Interface from the beginning, because it does not allow for type hinting, which would make implementations such as Zend_XmlRpc_Server (which predated Zend_Server_Interface) more complex (explicit checks in the code, instead of implicit checks via type hinting).

Won't fix.

Show
Matthew Weier O'Phinney added a comment - I was against Zend_Server_Interface from the beginning, because it does not allow for type hinting, which would make implementations such as Zend_XmlRpc_Server (which predated Zend_Server_Interface) more complex (explicit checks in the code, instead of implicit checks via type hinting). Won't fix.
Hide
Lars Strojny added a comment -

Aeh, what? Your opinion is fine. But as the other components implement this interface, don't you think it is a really good idea to implement that in Zend_XmlRpc_Server too? Just for the sake of completeness.
And yes, you are right, the type hinting thing is pretty sad, but at the end it is a PHP fault (see http://bugs.php.net/bug.php?id=37854). Not implementing Zend_Server_Interface in Zend_XmlRpc_Server would erase the possibility to have type-hinting for a consumer of Zend_Server-implementations. I think this is a valuable argument.

Show
Lars Strojny added a comment - Aeh, what? Your opinion is fine. But as the other components implement this interface, don't you think it is a really good idea to implement that in Zend_XmlRpc_Server too? Just for the sake of completeness. And yes, you are right, the type hinting thing is pretty sad, but at the end it is a PHP fault (see http://bugs.php.net/bug.php?id=37854). Not implementing Zend_Server_Interface in Zend_XmlRpc_Server would erase the possibility to have type-hinting for a consumer of Zend_Server-implementations. I think this is a valuable argument.
Hide
Matthew Weier O'Phinney added a comment -

Scheduling for next minor release.

Show
Matthew Weier O'Phinney added a comment - Scheduling for next minor release.
Hide
Matthew Weier O'Phinney added a comment -

Changes commited to trunk in r10683 and merged to 1.6 release branch in r10684.

Show
Matthew Weier O'Phinney added a comment - Changes commited to trunk in r10683 and merged to 1.6 release branch in r10684.
Hide
Wil Sinclair added a comment -

Updating for the 1.6.0 release.

Show
Wil Sinclair added a comment - Updating for the 1.6.0 release.

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
15m
Original Estimate - 15 minutes
Remaining:
15m
Remaining Estimate - 15 minutes
Logged:
Not Specified
Time Spent - Not Specified