Browse Source

Fix semantics to make code cleaner to read

- s/responseBody/requestBodies/ to properly indicate what we're
  iterating
- fixed some logical testing structures to follow CS as well as make
  intent clearer

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24202 44c647ce-9c0f-0410-b52a-842ac1e357ba
matthew 14 năm trước cách đây
mục cha
commit
26525f5f97
1 tập tin đã thay đổi với 12 bổ sung7 xóa
  1. 12 7
      library/Zend/Amf/Server.php

+ 12 - 7
library/Zend/Amf/Server.php

@@ -494,26 +494,28 @@ class Zend_Amf_Server implements Zend_Server_Interface
         // set response encoding
         $response->setObjectEncoding($objectEncoding);
 
-        $responseBody = $request->getAmfBodies();
+        $requestBodies = $request->getAmfBodies();
 
         $handleAuth = false;
         if ($this->_auth) {
             $headers = $request->getAmfHeaders();
-            if (isset($headers[Zend_Amf_Constants::CREDENTIALS_HEADER]) &&
-                isset($headers[Zend_Amf_Constants::CREDENTIALS_HEADER]->userid)) {
+            if (isset($headers[Zend_Amf_Constants::CREDENTIALS_HEADER]) 
+                && isset($headers[Zend_Amf_Constants::CREDENTIALS_HEADER]->userid)
+            ) {
                 $handleAuth = true;
             }
         }
 
         // Iterate through each of the service calls in the AMF request
-        foreach($responseBody as $body)
+        foreach($requestBodies as $body)
         {
             try {
                 if ($handleAuth) {
                     $message = '';
                     if ($this->_handleAuth(
-                        $headers[Zend_Amf_Constants::CREDENTIALS_HEADER]->userid,
-                        $headers[Zend_Amf_Constants::CREDENTIALS_HEADER]->password)) {
+                            $headers[Zend_Amf_Constants::CREDENTIALS_HEADER]->userid,
+                            $headers[Zend_Amf_Constants::CREDENTIALS_HEADER]->password
+                    )) {
                         // use RequestPersistentHeader to clear credentials
                         $response->addAmfHeader(
                             new Zend_Amf_Value_MessageHeader(
@@ -521,7 +523,10 @@ class Zend_Amf_Server implements Zend_Server_Interface
                                 false,
                                 new Zend_Amf_Value_MessageHeader(
                                     Zend_Amf_Constants::CREDENTIALS_HEADER,
-                                    false, null)));
+                                    false, null
+                                )
+                            )
+                        );
                         $handleAuth = false;
                     }
                 }