Passed
Push — master ( 6869ac...1a762a )
by Gaetano
07:15
created
demo/client/parallel.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once __DIR__ . "/_prepend.php";
2
+require_once __DIR__."/_prepend.php";
3 3
 
4 4
 use PhpXmlRpc\Encoder;
5 5
 use PhpXmlRpc\Client;
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
         $handles = array();
25 25
         $curl = curl_multi_init();
26 26
 
27
-        foreach($requests as $k => $req) {
27
+        foreach ($requests as $k => $req) {
28 28
             $req->setDebug($this->debug);
29 29
 
30 30
             $handle = $this->prepareCurlHandle(
@@ -57,19 +57,19 @@  discard block
 block discarded – undo
57 57
         $running = 0;
58 58
         do {
59 59
             curl_multi_exec($curl, $running);
60
-        } while($running > 0);
60
+        } while ($running>0);
61 61
 
62 62
         $responses = array();
63
-        foreach($handles as $k => $h) {
63
+        foreach ($handles as $k => $h) {
64 64
             $responses[$k] = curl_multi_getcontent($handles[$k]);
65 65
 
66
-            if ($this->debug > 1) {
66
+            if ($this->debug>1) {
67 67
                 $message = "---CURL INFO---\n";
68 68
                 foreach (curl_getinfo($h) as $name => $val) {
69 69
                     if (is_array($val)) {
70 70
                         $val = implode("\n", $val);
71 71
                     }
72
-                    $message .= $name . ': ' . $val . "\n";
72
+                    $message .= $name.': '.$val."\n";
73 73
                 }
74 74
                 $message .= '---END---';
75 75
                 $this->getLogger()->debugMessage($message);
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
         }
81 81
         curl_multi_close($curl);
82 82
 
83
-        foreach($responses as $k => $resp) {
83
+        foreach ($responses as $k => $resp) {
84 84
             if (!$resp) {
85
-                $responses[$k] = new Response(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'] . ': ' . curl_error($curl));
85
+                $responses[$k] = new Response(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'].': '.curl_error($curl));
86 86
             } else {
87 87
                 $responses[$k] = $requests[$k]->parseResponse($resp, true, $this->return_type);
88 88
             }
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 $value = $encoder->encode($data, array('auto_dates'));
100 100
 $req = new Request('interopEchoTests.echoValue', array($value));
101 101
 $reqs = array();
102
-for ($i = 0; $i < $num_tests; $i++) {
102
+for ($i = 0; $i<$num_tests; $i++) {
103 103
     $reqs[] = $req;
104 104
 }
105 105
 
@@ -114,18 +114,18 @@  discard block
 block discarded – undo
114 114
 
115 115
 $t = microtime(true);
116 116
 $resp = $client->send($reqs);
117
-$t = microtime(true) - $t;
118
-echo "Sequential send: " . sprintf('%.3f', $t) . " secs.\n";
117
+$t = microtime(true)-$t;
118
+echo "Sequential send: ".sprintf('%.3f', $t)." secs.\n";
119 119
 flush();
120 120
 
121 121
 $t = microtime(true);
122 122
 $resp = $client->sendParallel($reqs);
123
-$t = microtime(true) - $t;
124
-echo "Parallel send: " . sprintf('%.3f', $t) . " secs.\n";
123
+$t = microtime(true)-$t;
124
+echo "Parallel send: ".sprintf('%.3f', $t)." secs.\n";
125 125
 flush();
126 126
 
127 127
 $client->no_multicall = false;
128 128
 $t = microtime(true);
129 129
 $resp = $client->send($reqs);
130
-$t = microtime(true) - $t;
131
-echo "Multicall send: " . sprintf('%.3f', $t) . " secs.\n";
130
+$t = microtime(true)-$t;
131
+echo "Multicall send: ".sprintf('%.3f', $t)." secs.\n";
Please login to merge, or discard this patch.
demo/client/agesort.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once __DIR__ . "/_prepend.php";
2
+require_once __DIR__."/_prepend.php";
3 3
 
4 4
 output('<html lang="en">
5 5
 <head><title>xmlrpc - Agesort demo</title></head>
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
 output("This is the input data:<br/><pre>");
18 18
 foreach ($inAr as $key => $val) {
19
-    output($key . ", " . $val . "\n");
19
+    output($key.", ".$val."\n");
20 20
 }
21 21
 output("</pre>");
22 22
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     );
33 33
 }
34 34
 $v = new PhpXmlRpc\Value($p, "array");
35
-output("Encoded into xmlrpc format it looks like this: <pre>\n" . htmlentities($v->serialize()) . "</pre>\n");
35
+output("Encoded into xmlrpc format it looks like this: <pre>\n".htmlentities($v->serialize())."</pre>\n");
36 36
 
37 37
 // create client and message objects
38 38
 $req = new PhpXmlRpc\Request('examples.sortByAge', array($v));
@@ -52,15 +52,15 @@  discard block
 block discarded – undo
52 52
     foreach ($value as $struct) {
53 53
         $name = $struct["name"];
54 54
         $age = $struct["age"];
55
-        output(htmlspecialchars($name->scalarval()) . ", " . htmlspecialchars($age->scalarval()) . "\n");
55
+        output(htmlspecialchars($name->scalarval()).", ".htmlspecialchars($age->scalarval())."\n");
56 56
     }
57 57
 
58
-    output("<hr/>For nerds: I got this value back<br/><pre>" .
59
-        htmlentities($resp->serialize()) . "</pre><hr/>\n");
58
+    output("<hr/>For nerds: I got this value back<br/><pre>".
59
+        htmlentities($resp->serialize())."</pre><hr/>\n");
60 60
 } else {
61 61
     output("An error occurred:<pre>");
62
-    output("Code: " . htmlspecialchars($resp->faultCode()) .
63
-        "\nReason: '" . htmlspecialchars($resp->faultString()) . "'</pre><hr/>");
62
+    output("Code: ".htmlspecialchars($resp->faultCode()).
63
+        "\nReason: '".htmlspecialchars($resp->faultString())."'</pre><hr/>");
64 64
 }
65 65
 
66 66
 output("</body></html>\n");
Please login to merge, or discard this patch.