@@ -740,7 +740,7 @@ protected function generateMethodNameForClassMethod($className, $classMethod, $e
740740 * trusted servers ---
741741 * - mixed return_on_fault a php value to be returned when the xml-rpc call fails/returns
742742 * a fault response (by default the Response object is returned
743- * in this case). If a string is used, '%faultCode%' and
743+ * in this case). If a string is used, '%faultCode%' and
744744 * '%faultString%' tokens will be substituted with actual error values
745745 * - bool throw_on_fault if true, throw an exception instead of returning a Response
746746 * in case of errors/faults;
@@ -877,7 +877,7 @@ protected function retrieveMethodHelp($client, $methodName, array $extraOptions
877877 protected function buildWrapMethodClosure ($ client , $ methodName , array $ extraOptions , $ mSig )
878878 {
879879 // we clone the client, so that we can modify it a bit independently of the original
880- $ clientClone = clone $ client ;
880+ $ clientClone = $ this -> cloneClientForClosure ( $ client) ;
881881 $ function = function () use ($ clientClone , $ methodName , $ extraOptions , $ mSig )
882882 {
883883 $ timeout = isset ($ extraOptions ['timeout ' ]) ? (int )$ extraOptions ['timeout ' ] : 0 ;
@@ -1270,4 +1270,13 @@ public static function getHeldObject($index)
12701270
12711271 throw new ValueErrorException ("No object held for index ' $ index' " );
12721272 }
1273+
1274+ /**
1275+ * @param Client $client
1276+ * @return Client
1277+ */
1278+ protected function cloneClientForClosure ($ client )
1279+ {
1280+ return clone $ client ;
1281+ }
12731282}
0 commit comments