Passed
Push — master ( c803c8...b166f8 )
by Gaetano
05:21
created
src/Wrapper.php 2 patches
Spacing   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -190,20 +190,20 @@  discard block
 block discarded – undo
190 190
             $callable = explode('::', $callable);
191 191
         }
192 192
         if (is_array($callable)) {
193
-            if (count($callable) < 2 || (!is_string($callable[0]) && !is_object($callable[0]))) {
194
-                $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': syntax for function to be wrapped is wrong');
193
+            if (count($callable)<2 || (!is_string($callable[0]) && !is_object($callable[0]))) {
194
+                $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': syntax for function to be wrapped is wrong');
195 195
                 return false;
196 196
             }
197 197
             if (is_string($callable[0])) {
198 198
                 $plainFuncName = implode('::', $callable);
199 199
             } elseif (is_object($callable[0])) {
200
-                $plainFuncName = get_class($callable[0]) . '->' . $callable[1];
200
+                $plainFuncName = get_class($callable[0]).'->'.$callable[1];
201 201
             }
202 202
             $exists = method_exists($callable[0], $callable[1]);
203 203
         } else if ($callable instanceof \Closure) {
204 204
             // we do not support creating code which wraps closures, as php does not allow to serialize them
205 205
             if (!$buildIt) {
206
-                $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': a closure can not be wrapped in generated source code');
206
+                $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': a closure can not be wrapped in generated source code');
207 207
                 return false;
208 208
             }
209 209
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
         }
216 216
 
217 217
         if (!$exists) {
218
-            $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': function to be wrapped is not defined: ' . $plainFuncName);
218
+            $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': function to be wrapped is not defined: '.$plainFuncName);
219 219
             return false;
220 220
         }
221 221
 
@@ -259,23 +259,23 @@  discard block
 block discarded – undo
259 259
         if (is_array($callable)) {
260 260
             $func = new \ReflectionMethod($callable[0], $callable[1]);
261 261
             if ($func->isPrivate()) {
262
-                $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': method to be wrapped is private: ' . $plainFuncName);
262
+                $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': method to be wrapped is private: '.$plainFuncName);
263 263
                 return false;
264 264
             }
265 265
             if ($func->isProtected()) {
266
-                $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': method to be wrapped is protected: ' . $plainFuncName);
266
+                $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': method to be wrapped is protected: '.$plainFuncName);
267 267
                 return false;
268 268
             }
269 269
             if ($func->isConstructor()) {
270
-                $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': method to be wrapped is the constructor: ' . $plainFuncName);
270
+                $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': method to be wrapped is the constructor: '.$plainFuncName);
271 271
                 return false;
272 272
             }
273 273
             if ($func->isDestructor()) {
274
-                $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': method to be wrapped is the destructor: ' . $plainFuncName);
274
+                $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': method to be wrapped is the destructor: '.$plainFuncName);
275 275
                 return false;
276 276
             }
277 277
             if ($func->isAbstract()) {
278
-                $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': method to be wrapped is abstract: ' . $plainFuncName);
278
+                $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': method to be wrapped is abstract: '.$plainFuncName);
279 279
                 return false;
280 280
             }
281 281
             /// @todo add more checks for static vs. nonstatic?
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
         if ($func->isInternal()) {
286 286
             /// @todo from PHP 5.1.0 onward, we should be able to use invokeargs instead of getparameters to fully
287 287
             ///       reflect internal php functions
288
-            $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': function to be wrapped is internal: ' . $plainFuncName);
288
+            $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': function to be wrapped is internal: '.$plainFuncName);
289 289
             return false;
290 290
         }
291 291
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
         $i = 0;
338 338
         foreach ($func->getParameters() as $paramObj) {
339 339
             $params[$i] = array();
340
-            $params[$i]['name'] = '$' . $paramObj->getName();
340
+            $params[$i]['name'] = '$'.$paramObj->getName();
341 341
             $params[$i]['isoptional'] = $paramObj->isOptional();
342 342
             $i++;
343 343
         }
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
             // build a signature
402 402
             $sig = array($this->php2XmlrpcType($funcDesc['returns']));
403 403
             $pSig = array($funcDesc['returnsDocs']);
404
-            for ($i = 0; $i < count($pars); $i++) {
404
+            for ($i = 0; $i<count($pars); $i++) {
405 405
                 $name = strtolower($funcDesc['params'][$i]['name']);
406 406
                 if (isset($funcDesc['paramDocs'][$name]['type'])) {
407 407
                     $sig[] = $this->php2XmlrpcType($funcDesc['paramDocs'][$name]['type']);
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
                 }
458 458
             }
459 459
             $numPars = $req->getNumParams();
460
-            if ($numPars < $minPars || $numPars > $maxPars) {
460
+            if ($numPars<$minPars || $numPars>$maxPars) {
461 461
                 return new $responseClass(0, 3, 'Incorrect parameters passed to method');
462 462
             }
463 463
 
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 
471 471
             $result = call_user_func_array($callable, $params);
472 472
 
473
-            if (! is_a($result, $responseClass)) {
473
+            if (!is_a($result, $responseClass)) {
474 474
                 // q: why not do the same for int, float, bool, string?
475 475
                 if ($funcDesc['returns'] == Value::$xmlrpcDateTime || $funcDesc['returns'] == Value::$xmlrpcBase64) {
476 476
                     $result = new $valueClass($result, $funcDesc['returns']);
@@ -509,9 +509,9 @@  discard block
 block discarded – undo
509 509
         if ($newFuncName == '') {
510 510
             if (is_array($callable)) {
511 511
                 if (is_string($callable[0])) {
512
-                    $xmlrpcFuncName = "{$prefix}_" . implode('_', $callable);
512
+                    $xmlrpcFuncName = "{$prefix}_".implode('_', $callable);
513 513
                 } else {
514
-                    $xmlrpcFuncName = "{$prefix}_" . get_class($callable[0]) . '_' . $callable[1];
514
+                    $xmlrpcFuncName = "{$prefix}_".get_class($callable[0]).'_'.$callable[1];
515 515
                 }
516 516
             } else {
517 517
                 if ($callable instanceof \Closure) {
@@ -543,9 +543,9 @@  discard block
 block discarded – undo
543 543
      */
544 544
     protected function buildWrapFunctionSource($callable, $newFuncName, $extraOptions, $plainFuncName, $funcDesc)
545 545
     {
546
-        $encodeNulls = isset($extraOptions['encode_nulls']) ? (bool)$extraOptions['encode_nulls'] : false;
547
-        $encodePhpObjects = isset($extraOptions['encode_php_objs']) ? (bool)$extraOptions['encode_php_objs'] : false;
548
-        $decodePhpObjects = isset($extraOptions['decode_php_objs']) ? (bool)$extraOptions['decode_php_objs'] : false;
546
+        $encodeNulls = isset($extraOptions['encode_nulls']) ? (bool) $extraOptions['encode_nulls'] : false;
547
+        $encodePhpObjects = isset($extraOptions['encode_php_objs']) ? (bool) $extraOptions['encode_php_objs'] : false;
548
+        $decodePhpObjects = isset($extraOptions['decode_php_objs']) ? (bool) $extraOptions['decode_php_objs'] : false;
549 549
         $catchWarnings = isset($extraOptions['suppress_warnings']) && $extraOptions['suppress_warnings'] ? '@' : '';
550 550
 
551 551
         $i = 0;
@@ -580,9 +580,9 @@  discard block
 block discarded – undo
580 580
         // build body of new function
581 581
 
582 582
         $innerCode = "  \$paramCount = \$req->getNumParams();\n";
583
-        $innerCode .= "  if (\$paramCount < $minPars || \$paramCount > $maxPars) return new " . static::$namespace . "Response(0, " . PhpXmlRpc::$xmlrpcerr['incorrect_params'] . ", '" . PhpXmlRpc::$xmlrpcstr['incorrect_params'] . "');\n";
583
+        $innerCode .= "  if (\$paramCount < $minPars || \$paramCount > $maxPars) return new ".static::$namespace."Response(0, ".PhpXmlRpc::$xmlrpcerr['incorrect_params'].", '".PhpXmlRpc::$xmlrpcstr['incorrect_params']."');\n";
584 584
 
585
-        $innerCode .= "  \$encoder = new " . static::$namespace . "Encoder();\n";
585
+        $innerCode .= "  \$encoder = new ".static::$namespace."Encoder();\n";
586 586
         if ($decodePhpObjects) {
587 587
             $innerCode .= "  \$params = \$encoder->decode(\$req, array('decode_php_objs'));\n";
588 588
         } else {
@@ -595,23 +595,23 @@  discard block
 block discarded – undo
595 595
             static::holdObject($newFuncName, $callable[0]);
596 596
             $class = get_class($callable[0]);
597 597
             if ($class[0] !== '\\') {
598
-                $class = '\\' . $class;
598
+                $class = '\\'.$class;
599 599
             }
600 600
             $innerCode .= "  /// @var $class \$obj\n";
601 601
             $innerCode .= "  \$obj = PhpXmlRpc\\Wrapper::getHeldObject('$newFuncName');\n";
602
-            $realFuncName = '$obj->' . $callable[1];
602
+            $realFuncName = '$obj->'.$callable[1];
603 603
         } else {
604 604
             $realFuncName = $plainFuncName;
605 605
         }
606 606
         foreach ($parsVariations as $i => $pars) {
607
-            $innerCode .= "  if (\$paramCount == " . count($pars) . ") \$retVal = {$catchWarnings}$realFuncName(" . implode(',', $pars) . ");\n";
608
-            if ($i < (count($parsVariations) - 1))
607
+            $innerCode .= "  if (\$paramCount == ".count($pars).") \$retVal = {$catchWarnings}$realFuncName(".implode(',', $pars).");\n";
608
+            if ($i<(count($parsVariations)-1))
609 609
                 $innerCode .= "  else\n";
610 610
         }
611
-        $innerCode .= "  if (is_a(\$retVal, '" . static::$namespace . "Response'))\n    return \$retVal;\n  else\n";
611
+        $innerCode .= "  if (is_a(\$retVal, '".static::$namespace."Response'))\n    return \$retVal;\n  else\n";
612 612
         /// q: why not do the same for int, float, bool, string?
613 613
         if ($funcDesc['returns'] == Value::$xmlrpcDateTime || $funcDesc['returns'] == Value::$xmlrpcBase64) {
614
-            $innerCode .= "    return new " . static::$namespace . "Response(new " . static::$namespace . "Value(\$retVal, '{$funcDesc['returns']}'));";
614
+            $innerCode .= "    return new ".static::$namespace."Response(new ".static::$namespace."Value(\$retVal, '{$funcDesc['returns']}'));";
615 615
         } else {
616 616
             $encodeOptions = array();
617 617
             if ($encodeNulls) {
@@ -622,18 +622,18 @@  discard block
 block discarded – undo
622 622
             }
623 623
 
624 624
             if ($encodeOptions) {
625
-                $innerCode .= "    return new " . static::$namespace . "Response(\$encoder->encode(\$retVal, array('" .
626
-                    implode("', '", $encodeOptions) . "')));";
625
+                $innerCode .= "    return new ".static::$namespace."Response(\$encoder->encode(\$retVal, array('".
626
+                    implode("', '", $encodeOptions)."')));";
627 627
             } else {
628
-                $innerCode .= "    return new " . static::$namespace . "Response(\$encoder->encode(\$retVal));";
628
+                $innerCode .= "    return new ".static::$namespace."Response(\$encoder->encode(\$retVal));";
629 629
             }
630 630
         }
631 631
         // shall we exclude functions returning by ref?
632 632
         // if ($func->returnsReference())
633 633
         //     return false;
634 634
 
635
-        $code = "/**\n * @param \PhpXmlRpc\Request \$req\n * @return \PhpXmlRpc\Response\n * @throws \\Exception\n */\n" .
636
-            "function $newFuncName(\$req)\n{\n" . $innerCode . "\n}";
635
+        $code = "/**\n * @param \PhpXmlRpc\Request \$req\n * @return \PhpXmlRpc\Response\n * @throws \\Exception\n */\n".
636
+            "function $newFuncName(\$req)\n{\n".$innerCode."\n}";
637 637
 
638 638
         return $code;
639 639
     }
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
     protected function generateMethodNameForClassMethod($className, $classMethod, $extraOptions = array())
688 688
     {
689 689
         if (isset($extraOptions['replace_class_name']) && $extraOptions['replace_class_name']) {
690
-            return (isset($extraOptions['prefix']) ?  $extraOptions['prefix'] : '') . $classMethod;
690
+            return (isset($extraOptions['prefix']) ? $extraOptions['prefix'] : '').$classMethod;
691 691
         }
692 692
 
693 693
         if (is_object($className)) {
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
         } else {
696 696
             $realClassName = $className;
697 697
         }
698
-        return (isset($extraOptions['prefix']) ?  $extraOptions['prefix'] : '') . "$realClassName.$classMethod";
698
+        return (isset($extraOptions['prefix']) ? $extraOptions['prefix'] : '')."$realClassName.$classMethod";
699 699
     }
700 700
 
701 701
     /**
@@ -778,21 +778,21 @@  discard block
 block discarded – undo
778 778
      */
779 779
     protected function retrieveMethodSignature($client, $methodName, array $extraOptions = array())
780 780
     {
781
-        $reqClass = static::$namespace . 'Request';
782
-        $valClass = static::$namespace . 'Value';
783
-        $decoderClass = static::$namespace . 'Encoder';
781
+        $reqClass = static::$namespace.'Request';
782
+        $valClass = static::$namespace.'Value';
783
+        $decoderClass = static::$namespace.'Encoder';
784 784
 
785 785
         $debug = isset($extraOptions['debug']) ? ($extraOptions['debug']) : 0;
786
-        $timeout = isset($extraOptions['timeout']) ? (int)$extraOptions['timeout'] : 0;
786
+        $timeout = isset($extraOptions['timeout']) ? (int) $extraOptions['timeout'] : 0;
787 787
         $protocol = isset($extraOptions['protocol']) ? $extraOptions['protocol'] : '';
788
-        $sigNum = isset($extraOptions['signum']) ? (int)$extraOptions['signum'] : 0;
788
+        $sigNum = isset($extraOptions['signum']) ? (int) $extraOptions['signum'] : 0;
789 789
 
790 790
         $req = new $reqClass('system.methodSignature');
791 791
         $req->addparam(new $valClass($methodName));
792 792
         $client->setDebug($debug);
793 793
         $response = $client->send($req, $timeout, $protocol);
794 794
         if ($response->faultCode()) {
795
-            $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': could not retrieve method signature from remote server for method ' . $methodName);
795
+            $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': could not retrieve method signature from remote server for method '.$methodName);
796 796
             return false;
797 797
         }
798 798
 
@@ -803,8 +803,8 @@  discard block
 block discarded – undo
803 803
             $mSig = $decoder->decode($mSig);
804 804
         }
805 805
 
806
-        if (!is_array($mSig) || count($mSig) <= $sigNum) {
807
-            $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': could not retrieve method signature nr.' . $sigNum . ' from remote server for method ' . $methodName);
806
+        if (!is_array($mSig) || count($mSig)<=$sigNum) {
807
+            $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': could not retrieve method signature nr.'.$sigNum.' from remote server for method '.$methodName);
808 808
             return false;
809 809
         }
810 810
 
@@ -819,11 +819,11 @@  discard block
 block discarded – undo
819 819
      */
820 820
     protected function retrieveMethodHelp($client, $methodName, array $extraOptions = array())
821 821
     {
822
-        $reqClass = static::$namespace . 'Request';
823
-        $valClass = static::$namespace . 'Value';
822
+        $reqClass = static::$namespace.'Request';
823
+        $valClass = static::$namespace.'Value';
824 824
 
825 825
         $debug = isset($extraOptions['debug']) ? ($extraOptions['debug']) : 0;
826
-        $timeout = isset($extraOptions['timeout']) ? (int)$extraOptions['timeout'] : 0;
826
+        $timeout = isset($extraOptions['timeout']) ? (int) $extraOptions['timeout'] : 0;
827 827
         $protocol = isset($extraOptions['protocol']) ? $extraOptions['protocol'] : '';
828 828
 
829 829
         $mDesc = '';
@@ -857,11 +857,11 @@  discard block
 block discarded – undo
857 857
         $clientClone = clone $client;
858 858
         $function = function() use($clientClone, $methodName, $extraOptions, $mSig)
859 859
         {
860
-            $timeout = isset($extraOptions['timeout']) ? (int)$extraOptions['timeout'] : 0;
860
+            $timeout = isset($extraOptions['timeout']) ? (int) $extraOptions['timeout'] : 0;
861 861
             $protocol = isset($extraOptions['protocol']) ? $extraOptions['protocol'] : '';
862
-            $encodePhpObjects = isset($extraOptions['encode_php_objs']) ? (bool)$extraOptions['encode_php_objs'] : false;
863
-            $decodePhpObjects = isset($extraOptions['decode_php_objs']) ? (bool)$extraOptions['decode_php_objs'] : false;
864
-            $encodeNulls = isset($extraOptions['encode_nulls']) ? (bool)$extraOptions['encode_nulls'] : false;
862
+            $encodePhpObjects = isset($extraOptions['encode_php_objs']) ? (bool) $extraOptions['encode_php_objs'] : false;
863
+            $decodePhpObjects = isset($extraOptions['decode_php_objs']) ? (bool) $extraOptions['decode_php_objs'] : false;
864
+            $encodeNulls = isset($extraOptions['encode_nulls']) ? (bool) $extraOptions['encode_nulls'] : false;
865 865
             $throwFault = false;
866 866
             $decodeFault = false;
867 867
             $faultResponse = null;
@@ -872,9 +872,9 @@  discard block
 block discarded – undo
872 872
                 $faultResponse = $extraOptions['return_on_fault'];
873 873
             }
874 874
 
875
-            $reqClass = static::$namespace . 'Request';
876
-            $encoderClass = static::$namespace . 'Encoder';
877
-            $valueClass = static::$namespace . 'Value';
875
+            $reqClass = static::$namespace.'Request';
876
+            $encoderClass = static::$namespace.'Encoder';
877
+            $valueClass = static::$namespace.'Value';
878 878
 
879 879
             $encoder = new $encoderClass();
880 880
             $encodeOptions = array();
@@ -956,14 +956,14 @@  discard block
 block discarded – undo
956 956
      * @param string $mDesc
957 957
      * @return string[] keys: source, docstring
958 958
      */
959
-    public function buildWrapMethodSource($client, $methodName, array $extraOptions, $newFuncName, $mSig, $mDesc='')
959
+    public function buildWrapMethodSource($client, $methodName, array $extraOptions, $newFuncName, $mSig, $mDesc = '')
960 960
     {
961
-        $timeout = isset($extraOptions['timeout']) ? (int)$extraOptions['timeout'] : 0;
961
+        $timeout = isset($extraOptions['timeout']) ? (int) $extraOptions['timeout'] : 0;
962 962
         $protocol = isset($extraOptions['protocol']) ? $extraOptions['protocol'] : '';
963
-        $encodePhpObjects = isset($extraOptions['encode_php_objs']) ? (bool)$extraOptions['encode_php_objs'] : false;
964
-        $decodePhpObjects = isset($extraOptions['decode_php_objs']) ? (bool)$extraOptions['decode_php_objs'] : false;
965
-        $encodeNulls = isset($extraOptions['encode_nulls']) ? (bool)$extraOptions['encode_nulls'] : false;
966
-        $clientCopyMode = isset($extraOptions['simple_client_copy']) ? (int)($extraOptions['simple_client_copy']) : 0;
963
+        $encodePhpObjects = isset($extraOptions['encode_php_objs']) ? (bool) $extraOptions['encode_php_objs'] : false;
964
+        $decodePhpObjects = isset($extraOptions['decode_php_objs']) ? (bool) $extraOptions['decode_php_objs'] : false;
965
+        $encodeNulls = isset($extraOptions['encode_nulls']) ? (bool) $extraOptions['encode_nulls'] : false;
966
+        $clientCopyMode = isset($extraOptions['simple_client_copy']) ? (int) ($extraOptions['simple_client_copy']) : 0;
967 967
         $prefix = isset($extraOptions['prefix']) ? $extraOptions['prefix'] : 'xmlrpc';
968 968
         $throwFault = false;
969 969
         $decodeFault = false;
@@ -976,10 +976,10 @@  discard block
 block discarded – undo
976 976
         }
977 977
 
978 978
         $code = "function $newFuncName(";
979
-        if ($clientCopyMode < 2) {
979
+        if ($clientCopyMode<2) {
980 980
             // client copy mode 0 or 1 == full / partial client copy in emitted code
981 981
             $verbatimClientCopy = !$clientCopyMode;
982
-            $innerCode = '  ' . str_replace("\n", "\n  ", $this->buildClientWrapperCode($client, $verbatimClientCopy, $prefix, static::$namespace));
982
+            $innerCode = '  '.str_replace("\n", "\n  ", $this->buildClientWrapperCode($client, $verbatimClientCopy, $prefix, static::$namespace));
983 983
             $innerCode .= "\$client->setDebug(\$debug);\n";
984 984
             $this_ = '';
985 985
         } else {
@@ -987,28 +987,28 @@  discard block
 block discarded – undo
987 987
             $innerCode = '';
988 988
             $this_ = 'this->';
989 989
         }
990
-        $innerCode .= "  \$req = new " . static::$namespace . "Request('$methodName');\n";
990
+        $innerCode .= "  \$req = new ".static::$namespace."Request('$methodName');\n";
991 991
 
992 992
         if ($mDesc != '') {
993 993
             // take care that PHP comment is not terminated unwillingly by method description
994 994
             /// @todo according to the spec, method desc can have html in it. We should run it through strip_tags...
995
-            $mDesc = "/**\n * " . str_replace(array("\n", '*/'), array("\n * ", '* /'), $mDesc) . "\n";
995
+            $mDesc = "/**\n * ".str_replace(array("\n", '*/'), array("\n * ", '* /'), $mDesc)."\n";
996 996
         } else {
997 997
             $mDesc = "/**\n * Function $newFuncName.\n";
998 998
         }
999 999
 
1000 1000
         // param parsing
1001
-        $innerCode .= "  \$encoder = new " . static::$namespace . "Encoder();\n";
1001
+        $innerCode .= "  \$encoder = new ".static::$namespace."Encoder();\n";
1002 1002
         $plist = array();
1003 1003
         $pCount = count($mSig);
1004
-        for ($i = 1; $i < $pCount; $i++) {
1004
+        for ($i = 1; $i<$pCount; $i++) {
1005 1005
             $plist[] = "\$p$i";
1006 1006
             $pType = $mSig[$i];
1007 1007
             if ($pType == 'i4' || $pType == 'i8' || $pType == 'int' || $pType == 'boolean' || $pType == 'double' ||
1008 1008
                 $pType == 'string' || $pType == 'dateTime.iso8601' || $pType == 'base64' || $pType == 'null'
1009 1009
             ) {
1010 1010
                 // only build directly xml-rpc values when type is known and scalar
1011
-                $innerCode .= "  \$p$i = new " . static::$namespace . "Value(\$p$i, '$pType');\n";
1011
+                $innerCode .= "  \$p$i = new ".static::$namespace."Value(\$p$i, '$pType');\n";
1012 1012
             } else {
1013 1013
                 if ($encodePhpObjects || $encodeNulls) {
1014 1014
                     $encOpts = array();
@@ -1019,26 +1019,26 @@  discard block
 block discarded – undo
1019 1019
                         $encOpts[] = 'null_extension';
1020 1020
                     }
1021 1021
 
1022
-                    $innerCode .= "  \$p$i = \$encoder->encode(\$p$i, array( '" . implode("', '", $encOpts) . "'));\n";
1022
+                    $innerCode .= "  \$p$i = \$encoder->encode(\$p$i, array( '".implode("', '", $encOpts)."'));\n";
1023 1023
                 } else {
1024 1024
                     $innerCode .= "  \$p$i = \$encoder->encode(\$p$i);\n";
1025 1025
                 }
1026 1026
             }
1027 1027
             $innerCode .= "  \$req->addparam(\$p$i);\n";
1028
-            $mDesc .= " * @param " . $this->xmlrpc2PhpType($pType) . " \$p$i\n";
1028
+            $mDesc .= " * @param ".$this->xmlrpc2PhpType($pType)." \$p$i\n";
1029 1029
         }
1030
-        if ($clientCopyMode < 2) {
1030
+        if ($clientCopyMode<2) {
1031 1031
             $plist[] = '$debug = 0';
1032 1032
             $mDesc .= " * @param int \$debug when 1 (or 2) will enable debugging of the underlying {$prefix} call (defaults to 0)\n";
1033 1033
         }
1034 1034
         $plist = implode(', ', $plist);
1035
-        $mDesc .= ' * @return ' . $this->xmlrpc2PhpType($mSig[0]);
1035
+        $mDesc .= ' * @return '.$this->xmlrpc2PhpType($mSig[0]);
1036 1036
         if ($throwFault) {
1037
-            $mDesc .= "\n * @throws " . (is_string($throwFault) ? $throwFault : '\\Exception');
1037
+            $mDesc .= "\n * @throws ".(is_string($throwFault) ? $throwFault : '\\Exception');
1038 1038
         } else if ($decodeFault) {
1039
-            $mDesc .= '|' . gettype($faultResponse) . " (a " . gettype($faultResponse) . " if call fails)";
1039
+            $mDesc .= '|'.gettype($faultResponse)." (a ".gettype($faultResponse)." if call fails)";
1040 1040
         } else {
1041
-            $mDesc .= '|' . static::$namespace . "Response (a " . static::$namespace . "Response obj instance if call fails)";
1041
+            $mDesc .= '|'.static::$namespace."Response (a ".static::$namespace."Response obj instance if call fails)";
1042 1042
         }
1043 1043
         $mDesc .= "\n */\n";
1044 1044
 
@@ -1050,9 +1050,9 @@  discard block
 block discarded – undo
1050 1050
             $respCode = "throw new $throwFault(\$res->faultString(), \$res->faultCode())";
1051 1051
         } else if ($decodeFault) {
1052 1052
             if (is_string($faultResponse) && ((strpos($faultResponse, '%faultCode%') !== false) || (strpos($faultResponse, '%faultString%') !== false))) {
1053
-                $respCode = "return str_replace(array('%faultCode%', '%faultString%'), array(\$res->faultCode(), \$res->faultString()), '" . str_replace("'", "''", $faultResponse) . "')";
1053
+                $respCode = "return str_replace(array('%faultCode%', '%faultString%'), array(\$res->faultCode(), \$res->faultString()), '".str_replace("'", "''", $faultResponse)."')";
1054 1054
             } else {
1055
-                $respCode = 'return ' . var_export($faultResponse, true);
1055
+                $respCode = 'return '.var_export($faultResponse, true);
1056 1056
             }
1057 1057
         } else {
1058 1058
             $respCode = 'return $res';
@@ -1063,7 +1063,7 @@  discard block
 block discarded – undo
1063 1063
             $innerCode .= "  if (\$res->faultCode()) $respCode; else return \$encoder->decode(\$res->value());";
1064 1064
         }
1065 1065
 
1066
-        $code = $code . $plist . ")\n{\n" . $innerCode . "\n}\n";
1066
+        $code = $code.$plist.")\n{\n".$innerCode."\n}\n";
1067 1067
 
1068 1068
         return array('source' => $code, 'docstring' => $mDesc);
1069 1069
     }
@@ -1090,25 +1090,25 @@  discard block
 block discarded – undo
1090 1090
     public function wrapXmlrpcServer($client, $extraOptions = array())
1091 1091
     {
1092 1092
         $methodFilter = isset($extraOptions['method_filter']) ? $extraOptions['method_filter'] : '';
1093
-        $timeout = isset($extraOptions['timeout']) ? (int)$extraOptions['timeout'] : 0;
1093
+        $timeout = isset($extraOptions['timeout']) ? (int) $extraOptions['timeout'] : 0;
1094 1094
         $protocol = isset($extraOptions['protocol']) ? $extraOptions['protocol'] : '';
1095 1095
         $newClassName = isset($extraOptions['new_class_name']) ? $extraOptions['new_class_name'] : '';
1096
-        $encodeNulls = isset($extraOptions['encode_nulls']) ? (bool)$extraOptions['encode_nulls'] : false;
1097
-        $encodePhpObjects = isset($extraOptions['encode_php_objs']) ? (bool)$extraOptions['encode_php_objs'] : false;
1098
-        $decodePhpObjects = isset($extraOptions['decode_php_objs']) ? (bool)$extraOptions['decode_php_objs'] : false;
1096
+        $encodeNulls = isset($extraOptions['encode_nulls']) ? (bool) $extraOptions['encode_nulls'] : false;
1097
+        $encodePhpObjects = isset($extraOptions['encode_php_objs']) ? (bool) $extraOptions['encode_php_objs'] : false;
1098
+        $decodePhpObjects = isset($extraOptions['decode_php_objs']) ? (bool) $extraOptions['decode_php_objs'] : false;
1099 1099
         $verbatimClientCopy = isset($extraOptions['simple_client_copy']) ? !($extraOptions['simple_client_copy']) : true;
1100
-        $throwOnFault = isset($extraOptions['throw_on_fault']) ? (bool)$extraOptions['throw_on_fault'] : false;
1100
+        $throwOnFault = isset($extraOptions['throw_on_fault']) ? (bool) $extraOptions['throw_on_fault'] : false;
1101 1101
         $buildIt = isset($extraOptions['return_source']) ? !($extraOptions['return_source']) : true;
1102 1102
         $prefix = isset($extraOptions['prefix']) ? $extraOptions['prefix'] : 'xmlrpc';
1103 1103
 
1104
-        $reqClass = static::$namespace . 'Request';
1105
-        $decoderClass = static::$namespace . 'Encoder';
1104
+        $reqClass = static::$namespace.'Request';
1105
+        $decoderClass = static::$namespace.'Encoder';
1106 1106
 
1107 1107
         // retrieve the list of methods
1108 1108
         $req = new $reqClass('system.listMethods');
1109 1109
         $response = $client->send($req, $timeout, $protocol);
1110 1110
         if ($response->faultCode()) {
1111
-            $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': could not retrieve method list from remote server');
1111
+            $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': could not retrieve method list from remote server');
1112 1112
 
1113 1113
             return false;
1114 1114
         }
@@ -1119,7 +1119,7 @@  discard block
 block discarded – undo
1119 1119
             $mList = $decoder->decode($mList);
1120 1120
         }
1121 1121
         if (!is_array($mList) || !count($mList)) {
1122
-            $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': could not retrieve meaningful method list from remote server');
1122
+            $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': could not retrieve meaningful method list from remote server');
1123 1123
 
1124 1124
             return false;
1125 1125
         }
@@ -1128,8 +1128,8 @@  discard block
 block discarded – undo
1128 1128
         if ($newClassName != '') {
1129 1129
             $xmlrpcClassName = $newClassName;
1130 1130
         } else {
1131
-            $xmlrpcClassName = $prefix . '_' . preg_replace(array('/\./', '/[^a-zA-Z0-9_\x7f-\xff]/'),
1132
-                    array('_', ''), $client->server) . '_client';
1131
+            $xmlrpcClassName = $prefix.'_'.preg_replace(array('/\./', '/[^a-zA-Z0-9_\x7f-\xff]/'),
1132
+                    array('_', ''), $client->server).'_client';
1133 1133
         }
1134 1134
         while ($buildIt && class_exists($xmlrpcClassName)) {
1135 1135
             $xmlrpcClassName .= 'x';
@@ -1138,7 +1138,7 @@  discard block
 block discarded – undo
1138 1138
         /// @todo add method setDebug() to new class, to enable/disable debugging
1139 1139
         $source = "class $xmlrpcClassName\n{\n  public \$client;\n\n";
1140 1140
         $source .= "  function __construct()\n  {\n";
1141
-        $source .= '    ' . str_replace("\n", "\n    ", $this->buildClientWrapperCode($client, $verbatimClientCopy, $prefix, static::$namespace));
1141
+        $source .= '    '.str_replace("\n", "\n    ", $this->buildClientWrapperCode($client, $verbatimClientCopy, $prefix, static::$namespace));
1142 1142
         $source .= "\$this->client = \$client;\n  }\n\n";
1143 1143
         $opts = array(
1144 1144
             'return_source' => true,
@@ -1161,26 +1161,26 @@  discard block
 block discarded – undo
1161 1161
                 $methodWrap = $this->wrapXmlrpcMethod($client, $mName, $opts);
1162 1162
                 if ($methodWrap) {
1163 1163
                     if ($buildIt) {
1164
-                        $source .= $methodWrap['source'] . "\n";
1164
+                        $source .= $methodWrap['source']."\n";
1165 1165
 
1166 1166
                     } else {
1167
-                        $source .= '  ' . str_replace("\n", "\n  ", $methodWrap['docstring']);
1168
-                        $source .= str_replace("\n", "\n  ", $methodWrap['source']). "\n";
1167
+                        $source .= '  '.str_replace("\n", "\n  ", $methodWrap['docstring']);
1168
+                        $source .= str_replace("\n", "\n  ", $methodWrap['source'])."\n";
1169 1169
                     }
1170 1170
 
1171 1171
                 } else {
1172
-                    $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': will not create class method to wrap remote method ' . $mName);
1172
+                    $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': will not create class method to wrap remote method '.$mName);
1173 1173
                 }
1174 1174
             }
1175 1175
         }
1176 1176
         $source .= "}\n";
1177 1177
         if ($buildIt) {
1178 1178
             $allOK = 0;
1179
-            eval($source . '$allOK=1;');
1179
+            eval($source.'$allOK=1;');
1180 1180
             if ($allOK) {
1181 1181
                 return $xmlrpcClassName;
1182 1182
             } else {
1183
-                $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': could not create class ' . $xmlrpcClassName . ' to wrap remote server ' . $client->server);
1183
+                $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': could not create class '.$xmlrpcClassName.' to wrap remote server '.$client->server);
1184 1184
                 return false;
1185 1185
             }
1186 1186
         } else {
@@ -1199,8 +1199,8 @@  discard block
 block discarded – undo
1199 1199
      */
1200 1200
     protected function buildClientWrapperCode($client, $verbatimClientCopy, $prefix = 'xmlrpc', $namespace = '\\PhpXmlRpc\\')
1201 1201
     {
1202
-        $code = "\$client = new {$namespace}Client('" . str_replace(array("\\", "'"), array("\\\\", "\'"), $client->path) .
1203
-            "', '" . str_replace(array("\\", "'"), array("\\\\", "\'"), $client->server) . "', $client->port);\n";
1202
+        $code = "\$client = new {$namespace}Client('".str_replace(array("\\", "'"), array("\\\\", "\'"), $client->path).
1203
+            "', '".str_replace(array("\\", "'"), array("\\\\", "\'"), $client->server)."', $client->port);\n";
1204 1204
 
1205 1205
         // copy all client fields to the client that will be generated runtime
1206 1206
         // (this provides for future expansion or subclassing of client obj)
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -605,8 +605,9 @@
 block discarded – undo
605 605
         }
606 606
         foreach ($parsVariations as $i => $pars) {
607 607
             $innerCode .= "  if (\$paramCount == " . count($pars) . ") \$retVal = {$catchWarnings}$realFuncName(" . implode(',', $pars) . ");\n";
608
-            if ($i < (count($parsVariations) - 1))
609
-                $innerCode .= "  else\n";
608
+            if ($i < (count($parsVariations) - 1)) {
609
+                            $innerCode .= "  else\n";
610
+            }
610 611
         }
611 612
         $innerCode .= "  if (is_a(\$retVal, '" . static::$namespace . "Response'))\n    return \$retVal;\n  else\n";
612 613
         /// q: why not do the same for int, float, bool, string?
Please login to merge, or discard this patch.
tests/12ExtraFilesTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once __DIR__ . '/WebTestCase.php';
3
+include_once __DIR__.'/WebTestCase.php';
4 4
 
5 5
 /**
6 6
  * Tests for php files in the 'extras' directory.
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
         $this->args = argParser::getArgs();
13 13
 
14 14
         // assumes HTTPURI to be in the form /tests/index.php?etc...
15
-        $this->baseUrl = $this->args['HTTPSERVER'] . preg_replace('|\?.+|', '', $this->args['HTTPURI']);
16
-        $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . preg_replace('|/tests/index\.php(\?.*)?|', '/tests/phpunit_coverage.php', $this->args['HTTPURI']);
15
+        $this->baseUrl = $this->args['HTTPSERVER'].preg_replace('|\?.+|', '', $this->args['HTTPURI']);
16
+        $this->coverageScriptUrl = 'http://'.$this->args['HTTPSERVER'].preg_replace('|/tests/index\.php(\?.*)?|', '/tests/phpunit_coverage.php', $this->args['HTTPURI']);
17 17
     }
18 18
 
19 19
     public function testBenchmark()
Please login to merge, or discard this patch.
tests/01CharsetTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
  * @author JoakimLofgren
4 4
  */
5 5
 
6
-include_once __DIR__ . '/PolyfillTestCase.php';
6
+include_once __DIR__.'/PolyfillTestCase.php';
7 7
 
8 8
 use PhpXmlRpc\Helper\Charset;
9 9
 
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
     {
33 33
         // construct a latin string with all chars (except control ones)
34 34
         $this->latinString = "\n\r\t";
35
-        for($i = 32; $i < 127; $i++) {
35
+        for ($i = 32; $i<127; $i++) {
36 36
             $this->latinString .= chr($i);
37 37
         }
38
-        for($i = 160; $i < 256; $i++) {
38
+        for ($i = 160; $i<256; $i++) {
39 39
             $this->latinString .= chr($i);
40 40
         }
41 41
     }
Please login to merge, or discard this patch.
tests/06EncoderTest.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once __DIR__ . '/../lib/xmlrpc.inc';
4
-include_once __DIR__ . '/../lib/xmlrpcs.inc';
3
+include_once __DIR__.'/../lib/xmlrpc.inc';
4
+include_once __DIR__.'/../lib/xmlrpcs.inc';
5 5
 
6
-include_once __DIR__ . '/parse_args.php';
6
+include_once __DIR__.'/parse_args.php';
7 7
 
8
-include_once __DIR__ . '/PolyfillTestCase.php';
8
+include_once __DIR__.'/PolyfillTestCase.php';
9 9
 
10 10
 use PHPUnit\Runner\BaseTestRunner;
11 11
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         /// @todo it seems that old php versions can not automatically transform latin to utf8 upon xml parsing.
104 104
         ///       We should fix that, then re-enable this test
105 105
         if (version_compare(PHP_VERSION, '5.6.0', '>=')) {
106
-            $i = $e->decodeXml('<?xml version="1.0" encoding="ISO-8859-15" ?><value><string>' . $string . '</string></value>');
106
+            $i = $e->decodeXml('<?xml version="1.0" encoding="ISO-8859-15" ?><value><string>'.$string.'</string></value>');
107 107
             $this->assertEquals($string, $i->scalarVal());
108 108
         }
109 109
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,14 +21,16 @@
 block discarded – undo
21 21
     protected function set_up()
22 22
     {
23 23
         $this->args = argParser::getArgs();
24
-        if ($this->args['DEBUG'] == 1)
25
-            ob_start();
24
+        if ($this->args['DEBUG'] == 1) {
25
+                    ob_start();
26
+        }
26 27
     }
27 28
 
28 29
     protected function tear_down()
29 30
     {
30
-        if ($this->args['DEBUG'] != 1)
31
-            return;
31
+        if ($this->args['DEBUG'] != 1) {
32
+                    return;
33
+        }
32 34
         $out = ob_get_clean();
33 35
         $status = $this->getStatus();
34 36
         if ($status == BaseTestRunner::STATUS_ERROR
Please login to merge, or discard this patch.
tests/07ClientTest.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once __DIR__ . '/../lib/xmlrpc.inc';
3
+include_once __DIR__.'/../lib/xmlrpc.inc';
4 4
 
5
-include_once __DIR__ . '/parse_args.php';
5
+include_once __DIR__.'/parse_args.php';
6 6
 
7
-include_once __DIR__ . '/PolyfillTestCase.php';
7
+include_once __DIR__.'/PolyfillTestCase.php';
8 8
 
9 9
 use PHPUnit\Runner\BaseTestRunner;
10 10
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $this->client->server .= 'XXX';
59 59
         $dnsinfo = @dns_get_record($this->client->server);
60 60
         if ($dnsinfo) {
61
-            $this->markTestSkipped('Seems like there is a catchall DNS in effect: host ' . $this->client->server . ' found');
61
+            $this->markTestSkipped('Seems like there is a catchall DNS in effect: host '.$this->client->server.' found');
62 62
         } else {
63 63
             $r = $this->client->send($m, 5);
64 64
             // make sure there's no freaking catchall DNS in effect
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
         // now test a successful connection
87 87
         $server = explode(':', $this->args['HTTPSERVER']);
88
-        if (count($server) > 1) {
88
+        if (count($server)>1) {
89 89
             $this->client->port = $server[1];
90 90
         }
91 91
         $this->client->server = $server[0];
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,14 +24,16 @@
 block discarded – undo
24 24
         $this->client = new xmlrpc_client('/NOTEXIST.php', $this->args['HTTPSERVER'], 80);
25 25
         $this->client->setDebug($this->args['DEBUG']);
26 26
 
27
-        if ($this->args['DEBUG'] == 1)
28
-            ob_start();
27
+        if ($this->args['DEBUG'] == 1) {
28
+                    ob_start();
29
+        }
29 30
     }
30 31
 
31 32
     protected function tear_down()
32 33
     {
33
-        if ($this->args['DEBUG'] != 1)
34
-            return;
34
+        if ($this->args['DEBUG'] != 1) {
35
+                    return;
36
+        }
35 37
         $out = ob_get_clean();
36 38
         $status = $this->getStatus();
37 39
         if ($status == BaseTestRunner::STATUS_ERROR
Please login to merge, or discard this patch.
tests/08ServerTest.php 2 patches
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once __DIR__ . '/../lib/xmlrpc.inc';
4
-include_once __DIR__ . '/../lib/xmlrpc_wrappers.inc';
3
+include_once __DIR__.'/../lib/xmlrpc.inc';
4
+include_once __DIR__.'/../lib/xmlrpc_wrappers.inc';
5 5
 
6
-include_once __DIR__ . '/parse_args.php';
6
+include_once __DIR__.'/parse_args.php';
7 7
 
8
-include_once __DIR__ . '/PolyfillTestCase.php';
8
+include_once __DIR__.'/PolyfillTestCase.php';
9 9
 
10 10
 use PHPUnit\Extensions\SeleniumCommon\RemoteCoverage;
11 11
 use PHPUnit\Framework\TestResult;
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         // (but only if not called from subclass objects / multitests)
43 43
         if (function_exists('debug_backtrace') && strtolower(get_called_class()) == 'localhosttests') {
44 44
             $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
45
-            for ($i = 0; $i < count($trace); $i++) {
45
+            for ($i = 0; $i<count($trace); $i++) {
46 46
                 if (strpos($trace[$i]['function'], 'test') === 0) {
47 47
                     self::$failed_tests[$trace[$i]['function']] = true;
48 48
                     break;
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function _run($result = NULL)
67 67
     {
68
-        $this->testId = get_class($this) . '__' . $this->getName();
68
+        $this->testId = get_class($this).'__'.$this->getName();
69 69
 
70 70
         if ($result === NULL) {
71 71
             $result = $this->createResult();
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         $this->args = argParser::getArgs();
97 97
 
98 98
         $server = explode(':', $this->args['HTTPSERVER']);
99
-        if (count($server) > 1) {
99
+        if (count($server)>1) {
100 100
             $this->client = new xmlrpc_client($this->args['HTTPURI'], $server[0], $server[1]);
101 101
         } else {
102 102
             $this->client = new xmlrpc_client($this->args['HTTPURI'], $this->args['HTTPSERVER']);
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         $this->client->request_compression = $this->request_compression;
107 107
         $this->client->accepted_compression = $this->accepted_compression;
108 108
 
109
-        $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . preg_replace('|/tests/index\.php(\?.*)?|', '/tests/phpunit_coverage.php', $this->args['HTTPURI']);
109
+        $this->coverageScriptUrl = 'http://'.$this->args['HTTPSERVER'].preg_replace('|/tests/index\.php(\?.*)?|', '/tests/phpunit_coverage.php', $this->args['HTTPURI']);
110 110
 
111 111
         if ($this->args['DEBUG'] == 1)
112 112
             ob_start();
@@ -143,9 +143,9 @@  discard block
 block discarded – undo
143 143
         }
144 144
         $this->validateResponse($r);
145 145
         if (is_array($errorCode)) {
146
-            $this->assertContains($r->faultCode(), $errorCode, 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString());
146
+            $this->assertContains($r->faultCode(), $errorCode, 'Error '.$r->faultCode().' connecting to server: '.$r->faultString());
147 147
         } else {
148
-            $this->assertEquals($errorCode, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString());
148
+            $this->assertEquals($errorCode, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString());
149 149
         }
150 150
         if (!$r->faultCode()) {
151 151
             if ($returnResponse) {
@@ -172,20 +172,20 @@  discard block
 block discarded – undo
172 172
         $query = parse_url($this->client->path, PHP_URL_QUERY);
173 173
         parse_str($query, $vars);
174 174
         $query = http_build_query(array_merge($vars, $data));
175
-        $this->client->path = parse_url($this->client->path, PHP_URL_PATH) . '?' . $query;
175
+        $this->client->path = parse_url($this->client->path, PHP_URL_PATH).'?'.$query;
176 176
     }
177 177
 
178 178
     public function testString()
179 179
     {
180
-        $sendString = "here are 3 \"entities\": < > & " .
181
-            "and here's a dollar sign: \$pretendvarname and a backslash too: " . chr(92) .
182
-            " - isn't that great? \\\"hackery\\\" at it's best " .
183
-            " also don't want to miss out on \$item[0]. " .
184
-            "The real weird stuff follows: CRLF here" . chr(13) . chr(10) .
185
-            "a simple CR here" . chr(13) .
186
-            "a simple LF here" . chr(10) .
187
-            "and then LFCR" . chr(10) . chr(13) .
188
-            "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne, and an xml comment closing tag: -->";
180
+        $sendString = "here are 3 \"entities\": < > & ".
181
+            "and here's a dollar sign: \$pretendvarname and a backslash too: ".chr(92).
182
+            " - isn't that great? \\\"hackery\\\" at it's best ".
183
+            " also don't want to miss out on \$item[0]. ".
184
+            "The real weird stuff follows: CRLF here".chr(13).chr(10).
185
+            "a simple CR here".chr(13).
186
+            "a simple LF here".chr(10).
187
+            "and then LFCR".chr(10).chr(13).
188
+            "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne, and an xml comment closing tag: -->";
189 189
         $m = new xmlrpcmsg('examples.stringecho', array(
190 190
             new xmlrpcval($sendString, 'string'),
191 191
         ));
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
     public function testLatin1String()
207 207
     {
208 208
         $sendString =
209
-            "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne";
209
+            "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne";
210 210
         $x = '<?xml version="1.0" encoding="ISO-8859-1"?><methodCall><methodName>examples.stringecho</methodName><params><param><value>'.
211 211
             $sendString.
212 212
             '</value></param></params></methodCall>';
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
     public function testUtf8Method()
316 316
     {
317 317
         PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding = 'UTF-8';
318
-        $m = new xmlrpcmsg("tests.utf8methodname." . 'κόσμε', array(
318
+        $m = new xmlrpcmsg("tests.utf8methodname.".'κόσμε', array(
319 319
             new xmlrpcval('hello')
320 320
         ));
321 321
         $v = $this->send($m);
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
         ));
338 338
         $v = $this->send($m);
339 339
         if ($v) {
340
-            $this->assertEquals($a + $b, $v->scalarval());
340
+            $this->assertEquals($a+$b, $v->scalarval());
341 341
         }
342 342
     }
343 343
 
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
         ));
350 350
         $v = $this->send($m);
351 351
         if ($v) {
352
-            $this->assertEquals(12 - 23, $v->scalarval());
352
+            $this->assertEquals(12-23, $v->scalarval());
353 353
         }
354 354
     }
355 355
 
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
         if ($v) {
384 384
             $sz = $v->arraysize();
385 385
             $got = '';
386
-            for ($i = 0; $i < $sz; $i++) {
386
+            for ($i = 0; $i<$sz; $i++) {
387 387
                 $b = $v->arraymem($i);
388 388
                 if ($b->scalarval()) {
389 389
                     $got .= '1';
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
             $got = '';
447 447
             $expected = '37210';
448 448
             $expect_array = array('ctLeftAngleBrackets', 'ctRightAngleBrackets', 'ctAmpersands', 'ctApostrophes', 'ctQuotes');
449
-            foreach($expect_array as $val) {
449
+            foreach ($expect_array as $val) {
450 450
                 $b = $v->structmem($val);
451 451
                 $got .= $b->me['int'];
452 452
             }
@@ -899,7 +899,7 @@  discard block
 block discarded – undo
899 899
     {
900 900
         // make a 'deep client copy' as the original one might have many properties set
901 901
         // also for speed only wrap one method of the whole server
902
-        $class = wrap_xmlrpc_server($this->client, array('simple_client_copy' => 0, 'method_filter' => '/examples\.getStateName/' ));
902
+        $class = wrap_xmlrpc_server($this->client, array('simple_client_copy' => 0, 'method_filter' => '/examples\.getStateName/'));
903 903
         if ($class == '') {
904 904
             $this->fail('Registration of remote server failed');
905 905
         } else {
@@ -938,9 +938,9 @@  discard block
 block discarded – undo
938 938
         $cookies = array(
939 939
             //'c1' => array(),
940 940
             'c2' => array('value' => 'c2'),
941
-            'c3' => array('value' => 'c3', 'expires' => time() + 60 * 60 * 24 * 30),
942
-            'c4' => array('value' => 'c4', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/'),
943
-            'c5' => array('value' => 'c5', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'),
941
+            'c3' => array('value' => 'c3', 'expires' => time()+60 * 60 * 24 * 30),
942
+            'c4' => array('value' => 'c4', 'expires' => time()+60 * 60 * 24 * 30, 'path' => '/'),
943
+            'c5' => array('value' => 'c5', 'expires' => time()+60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'),
944 944
         );
945 945
         $cookiesval = php_xmlrpc_encode($cookies);
946 946
         $m = new xmlrpcmsg('tests.setcookies', array($cookiesval));
@@ -988,10 +988,10 @@  discard block
 block discarded – undo
988 988
         $m = new xmlrpcmsg('tests.getcookies', array());
989 989
         foreach ($cookies as $cookie => $val) {
990 990
             $this->client->setCookie($cookie, $val);
991
-            $cookies[$cookie] = (string)$cookies[$cookie];
991
+            $cookies[$cookie] = (string) $cookies[$cookie];
992 992
         }
993 993
         $r = $this->client->send($m, $this->timeout, $this->method);
994
-        $this->assertEquals(0, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString());
994
+        $this->assertEquals(0, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString());
995 995
         if (!$r->faultCode()) {
996 996
             $v = $r->value();
997 997
             $v = php_xmlrpc_decode($v);
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -108,14 +108,16 @@
 block discarded – undo
108 108
 
109 109
         $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . preg_replace('|/tests/index\.php(\?.*)?|', '/tests/phpunit_coverage.php', $this->args['HTTPURI']);
110 110
 
111
-        if ($this->args['DEBUG'] == 1)
112
-            ob_start();
111
+        if ($this->args['DEBUG'] == 1) {
112
+                    ob_start();
113
+        }
113 114
     }
114 115
 
115 116
     protected function tear_down()
116 117
     {
117
-        if ($this->args['DEBUG'] != 1)
118
-            return;
118
+        if ($this->args['DEBUG'] != 1) {
119
+                    return;
120
+        }
119 121
         $out = ob_get_clean();
120 122
         $status = $this->getStatus();
121 123
         if ($status == BaseTestRunner::STATUS_ERROR
Please login to merge, or discard this patch.
tests/02ValueTest.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once __DIR__ . '/../lib/xmlrpc.inc';
4
-include_once __DIR__ . '/../lib/xmlrpcs.inc';
3
+include_once __DIR__.'/../lib/xmlrpc.inc';
4
+include_once __DIR__.'/../lib/xmlrpcs.inc';
5 5
 
6
-include_once __DIR__ . '/parse_args.php';
6
+include_once __DIR__.'/parse_args.php';
7 7
 
8
-include_once __DIR__ . '/PolyfillTestCase.php';
8
+include_once __DIR__.'/PolyfillTestCase.php';
9 9
 
10 10
 use PHPUnit\Runner\BaseTestRunner;
11 11
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         $this->assertequals(1, count($v1));
129 129
         $out = array('me' => array(), 'mytype' => 2, '_php_class' => null);
130 130
 
131
-        foreach($v1 as $key => $val)
131
+        foreach ($v1 as $key => $val)
132 132
         {
133 133
             $this->assertArrayHasKey($key, $out);
134 134
             $expected = $out[$key];
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         $this->assertequals(2, count($v2));
144 144
         $out = array(array('key' => 0, 'value'  => 'object'), array('key' => 1, 'value'  => 'object'));
145 145
         $i = 0;
146
-        foreach($v2 as $key => $val)
146
+        foreach ($v2 as $key => $val)
147 147
         {
148 148
             $expected = $out[$i];
149 149
             $this->assertequals($expected['key'], $key);
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     {
158 158
         // nb: make sure that  the serialized xml corresponding to this is > 10MB in size
159 159
         $data = array();
160
-        for ($i = 0; $i < 500000; $i++ ) {
160
+        for ($i = 0; $i<500000; $i++) {
161 161
             $data[] = 'hello world';
162 162
         }
163 163
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,14 +21,16 @@
 block discarded – undo
21 21
     protected function set_up()
22 22
     {
23 23
         $this->args = argParser::getArgs();
24
-        if ($this->args['DEBUG'] == 1)
25
-            ob_start();
24
+        if ($this->args['DEBUG'] == 1) {
25
+                    ob_start();
26
+        }
26 27
     }
27 28
 
28 29
     protected function tear_down()
29 30
     {
30
-        if ($this->args['DEBUG'] != 1)
31
-            return;
31
+        if ($this->args['DEBUG'] != 1) {
32
+                    return;
33
+        }
32 34
         $out = ob_get_clean();
33 35
         $status = $this->getStatus();
34 36
         if ($status == BaseTestRunner::STATUS_ERROR
Please login to merge, or discard this patch.
tests/03ParsingTest.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once __DIR__ . '/../lib/xmlrpc.inc';
4
-include_once __DIR__ . '/../lib/xmlrpcs.inc';
3
+include_once __DIR__.'/../lib/xmlrpc.inc';
4
+include_once __DIR__.'/../lib/xmlrpcs.inc';
5 5
 
6
-include_once __DIR__ . '/parse_args.php';
6
+include_once __DIR__.'/parse_args.php';
7 7
 
8
-include_once __DIR__ . '/PolyfillTestCase.php';
8
+include_once __DIR__.'/PolyfillTestCase.php';
9 9
 
10 10
 use PHPUnit\Runner\BaseTestRunner;
11 11
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
     public function testI8()
131 131
     {
132
-        if (PHP_INT_SIZE == 4 ) {
132
+        if (PHP_INT_SIZE == 4) {
133 133
             $this->markTestSkipped('Can not test i8 as php is compiled in 32 bit mode');
134 134
             return;
135 135
         }
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 
205 205
     public function testUnicodeInMemberName()
206 206
     {
207
-        $str = "G" . chr(252) . "nter, El" . chr(232) . "ne";
207
+        $str = "G".chr(252)."nter, El".chr(232)."ne";
208 208
         $v = array($str => new xmlrpcval(1));
209 209
         $r = new xmlrpcresp(new xmlrpcval($v, 'struct'));
210 210
         $r = $r->serialize();
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         $response = @utf8_encode(
221 221
             '<?xml version="1.0"?>
222 222
 <!-- covers what happens when lib receives UTF8 chars in response text and comments -->
223
-<!-- ' . chr(224) . chr(252) . chr(232) . '&#224;&#252;&#232; -->
223
+<!-- ' . chr(224).chr(252).chr(232).'&#224;&#252;&#232; -->
224 224
 <methodResponse>
225 225
 <fault>
226 226
 <value>
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 </member>
232 232
 <member>
233 233
 <name>faultString</name>
234
-<value><string>' . chr(224) . chr(252) . chr(232) . '&#224;&#252;&#232;</string></value>
234
+<value><string>' . chr(224).chr(252).chr(232).'&#224;&#252;&#232;</string></value>
235 235
 </member>
236 236
 </struct>
237 237
 </value>
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         $m = $this->newRequest('dummy');
241 241
         $r = $m->parseResponse($response);
242 242
         $v = $r->faultString();
243
-        $this->assertEquals(chr(224) . chr(252) . chr(232) . chr(224) . chr(252) . chr(232), $v);
243
+        $this->assertEquals(chr(224).chr(252).chr(232).chr(224).chr(252).chr(232), $v);
244 244
     }
245 245
 
246 246
     public function testBrokenRequests()
@@ -447,8 +447,8 @@  discard block
 block discarded – undo
447 447
         $i = \PhpXmlRpc\PhpXmlRpc::$xmlrpc_reject_invalid_values;
448 448
         \PhpXmlRpc\PhpXmlRpc::$xmlrpc_reject_invalid_values = true;
449 449
 
450
-        foreach($values as $value) {
451
-            $f = '<?xml version="1.0"?><methodResponse><params><param><value>' . $value . '</value></param></params></methodResponse> ';
450
+        foreach ($values as $value) {
451
+            $f = '<?xml version="1.0"?><methodResponse><params><param><value>'.$value.'</value></param></params></methodResponse> ';
452 452
             $r = $s->parseResponse($f);
453 453
             $v = $r->faultCode();
454 454
             $this->assertEquals(2, $v, "Testing $value");
@@ -552,11 +552,11 @@  discard block
 block discarded – undo
552 552
 
553 553
     public function testUTF8Response()
554 554
     {
555
-        $string = chr(224) . chr(252) . chr(232);
555
+        $string = chr(224).chr(252).chr(232);
556 556
 
557 557
         $s = $this->newRequest('dummy');
558
-        $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=UTF-8\r\n\r\n" . '<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
559
-<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . @utf8_encode($string) . '</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
558
+        $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=UTF-8\r\n\r\n".'<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
559
+<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . @utf8_encode($string).'</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
560 560
 ';
561 561
         $r = $s->parseResponse($f, false, 'phpvals');
562 562
         $v = $r->value();
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
         $this->assertEquals($string, $v);
565 565
 
566 566
         $f = '<?xml version="1.0" encoding="UTF-8"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
567
-<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . @utf8_encode($string) . '</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
567
+<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . @utf8_encode($string).'</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
568 568
 ';
569 569
         $r = $s->parseResponse($f, false, 'phpvals');
570 570
         $v = $r->value();
@@ -580,11 +580,11 @@  discard block
 block discarded – undo
580 580
 
581 581
     public function testLatin1Response()
582 582
     {
583
-        $string = chr(224) . chr(252) . chr(232);
583
+        $string = chr(224).chr(252).chr(232);
584 584
 
585 585
         $s = $this->newRequest('dummy');
586
-        $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=ISO-8859-1\r\n\r\n" . '<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
587
-<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . $string . '</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
586
+        $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=ISO-8859-1\r\n\r\n".'<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
587
+<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . $string.'</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
588 588
 ';
589 589
         $r = $s->parseResponse($f, false, 'phpvals');
590 590
         $v = $r->value();
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
         $this->assertEquals($string, $v);
593 593
 
594 594
         $f = '<?xml version="1.0" encoding="ISO-8859-1"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
595
-<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . $string . '</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
595
+<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . $string.'</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
596 596
 ';
597 597
         $r = $s->parseResponse($f, false, 'phpvals');
598 598
         $v = $r->value();
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,14 +21,16 @@
 block discarded – undo
21 21
     protected function set_up()
22 22
     {
23 23
         $this->args = argParser::getArgs();
24
-        if ($this->args['DEBUG'] == 1)
25
-            ob_start();
24
+        if ($this->args['DEBUG'] == 1) {
25
+                    ob_start();
26
+        }
26 27
     }
27 28
 
28 29
     protected function tear_down()
29 30
     {
30
-        if ($this->args['DEBUG'] != 1)
31
-            return;
31
+        if ($this->args['DEBUG'] != 1) {
32
+                    return;
33
+        }
32 34
         $out = ob_get_clean();
33 35
         $status = $this->getStatus();
34 36
         if ($status == BaseTestRunner::STATUS_ERROR
Please login to merge, or discard this patch.
tests/09HTTPTest.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once __DIR__ . '/../lib/xmlrpc.inc';
4
-include_once __DIR__ . '/../lib/xmlrpc_wrappers.inc';
3
+include_once __DIR__.'/../lib/xmlrpc.inc';
4
+include_once __DIR__.'/../lib/xmlrpc_wrappers.inc';
5 5
 
6
-include_once __DIR__ . '/parse_args.php';
6
+include_once __DIR__.'/parse_args.php';
7 7
 
8
-include_once __DIR__ . '/08ServerTest.php';
8
+include_once __DIR__.'/08ServerTest.php';
9 9
 
10 10
 /**
11 11
  * Tests which stress http features of the library.
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         );
31 31
 
32 32
         $methods = array();
33
-        foreach(get_class_methods('ServerTest') as $method)
33
+        foreach (get_class_methods('ServerTest') as $method)
34 34
         {
35 35
             if (strpos($method, 'test') === 0 && !in_array($method, $unsafeMethods))
36 36
             {
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
                 preg_match('/ubunutu([0-9]+)/', $output[0], $matches);
305 305
                 $ubuntuVersion = @$matches[1];
306 306
             }
307
-            if ($ubuntuVersion >= 20) {
307
+            if ($ubuntuVersion>=20) {
308 308
                 $this->markTestSkipped('HTTPS via Socket known to fail on php less than 7.2 on Ubuntu 20 and higher');
309 309
                 return;
310 310
             }
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -201,8 +201,7 @@  discard block
 block discarded – undo
201 201
         {
202 202
             $this->markTestSkipped('CURL missing: cannot test http 1.1 w. proxy');
203 203
             return;
204
-        }
205
-        else if ($this->args['PROXYSERVER'] == '')
204
+        } else if ($this->args['PROXYSERVER'] == '')
206 205
         {
207 206
             $this->markTestSkipped('PROXYSERVER definition missing: cannot test proxy w. http 1.1');
208 207
             return;
@@ -226,8 +225,7 @@  discard block
 block discarded – undo
226 225
         {
227 226
             $this->markTestSkipped('CURL missing: cannot test https functionality');
228 227
             return;
229
-        }
230
-        else if ($this->args['HTTPSSERVER'] == '')
228
+        } else if ($this->args['HTTPSSERVER'] == '')
231 229
         {
232 230
             $this->markTestSkipped('HTTPS SERVER definition missing: cannot test https');
233 231
             return;
@@ -278,13 +276,11 @@  discard block
 block discarded – undo
278 276
         {
279 277
             $this->markTestSkipped('CURL missing: cannot test https w. proxy');
280 278
             return;
281
-        }
282
-        else if ($this->args['PROXYSERVER'] == '')
279
+        } else if ($this->args['PROXYSERVER'] == '')
283 280
         {
284 281
             $this->markTestSkipped('PROXYSERVER definition missing: cannot test proxy w. https');
285 282
             return;
286
-        }
287
-        else if ($this->args['HTTPSSERVER'] == '')
283
+        } else if ($this->args['HTTPSSERVER'] == '')
288 284
         {
289 285
             $this->markTestSkipped('HTTPS SERVER definition missing: cannot test https w. proxy');
290 286
             return;
Please login to merge, or discard this patch.