Passed
Push — master ( 0c11b8...7877a8 )
by Gaetano
09:59
created
demo/server/discuss.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  * It uses a Berkeley DB database for storage.
5 5
  */
6 6
 
7
-require_once __DIR__ . "/_prepend.php";
7
+require_once __DIR__."/_prepend.php";
8 8
 
9 9
 use PhpXmlRpc\Value;
10 10
 
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
             $count = 0;
36 36
         }
37 37
         // add the new comment in
38
-        dba_insert($msgID . "_comment_${count}", $comment, $dbh);
39
-        dba_insert($msgID . "_name_${count}", $name, $dbh);
38
+        dba_insert($msgID."_comment_${count}", $comment, $dbh);
39
+        dba_insert($msgID."_name_${count}", $name, $dbh);
40 40
         $count++;
41 41
         dba_replace($countID, $count, $dbh);
42 42
         dba_close($dbh);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         $countID = "${msgID}_count";
70 70
         if (dba_exists($countID, $dbh)) {
71 71
             $count = dba_fetch($countID, $dbh);
72
-            for ($i = 0; $i < $count; $i++) {
72
+            for ($i = 0; $i<$count; $i++) {
73 73
                 $name = dba_fetch("${msgID}_name_${i}", $dbh);
74 74
                 $comment = dba_fetch("${msgID}_comment_${i}", $dbh);
75 75
                 // push a new struct onto the return array
@@ -107,4 +107,4 @@  discard block
 block discarded – undo
107 107
     ),
108 108
 ));
109 109
 
110
-require_once __DIR__ . "/_append.php";
110
+require_once __DIR__."/_append.php";
Please login to merge, or discard this patch.
demo/client/getstatename.php 1 patch
Spacing   +9 added lines, -9 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 - Getstatename demo</title></head>
@@ -11,34 +11,34 @@  discard block
 block discarded – undo
11 11
 ');
12 12
 
13 13
 if (isset($_POST["stateno"]) && $_POST["stateno"] != "") {
14
-    $stateNo = (integer)$_POST["stateno"];
14
+    $stateNo = (integer) $_POST["stateno"];
15 15
     $encoder = new PhpXmlRpc\Encoder();
16 16
     $req = new PhpXmlRpc\Request('examples.getStateName',
17 17
         array($encoder->encode($stateNo))
18 18
     );
19
-    output("Sending the following request:<pre>\n\n" . htmlentities($req->serialize()) . "\n\n</pre>Debug info of server data follows...\n\n");
19
+    output("Sending the following request:<pre>\n\n".htmlentities($req->serialize())."\n\n</pre>Debug info of server data follows...\n\n");
20 20
     $client = new PhpXmlRpc\Client(XMLRPCSERVER);
21 21
     $client->setDebug(1);
22 22
     $r = $client->send($req);
23 23
     if (!$r->faultCode()) {
24 24
         $v = $r->value();
25
-        output("<br/>State number <b>" . $stateNo . "</b> is <b>"
26
-            . htmlspecialchars($encoder->decode($v)) . "</b><br/><br/>");
25
+        output("<br/>State number <b>".$stateNo."</b> is <b>"
26
+            . htmlspecialchars($encoder->decode($v))."</b><br/><br/>");
27 27
     } else {
28 28
         output("An error occurred: ");
29
-        output("Code: " . htmlspecialchars($r->faultCode())
30
-            . " Reason: '" . htmlspecialchars($r->faultString()) . "'</pre><br/>");
29
+        output("Code: ".htmlspecialchars($r->faultCode())
30
+            . " Reason: '".htmlspecialchars($r->faultString())."'</pre><br/>");
31 31
     }
32 32
 } else {
33 33
     $stateNo = "";
34 34
 }
35 35
 
36 36
 output("<form action=\"getstatename.php\" method=\"POST\">
37
-<input name=\"stateno\" value=\"" . $stateNo . "\">
37
+<input name=\"stateno\" value=\"" . $stateNo."\">
38 38
 <input type=\"submit\" value=\"go\" name=\"submit\">
39 39
 </form>
40 40
 <p>Enter a state number to query its name</p>");
41 41
 
42 42
 output("</body></html>\n");
43 43
 
44
-require_once __DIR__ . "/_append.php";
44
+require_once __DIR__."/_append.php";
Please login to merge, or discard this patch.
demo/client/_append.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,5 +3,5 @@
 block discarded – undo
3 3
 // Out-of-band information: let the client manipulate the page operations.
4 4
 // We do this to help the testsuite script: do not reproduce in production!
5 5
 if (isset($_COOKIE['PHPUNIT_SELENIUM_TEST_ID']) && extension_loaded('xdebug')) {
6
-    include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/append.php";
6
+    include_once __DIR__."/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/append.php";
7 7
 }
Please login to merge, or discard this patch.
demo/client/parallel.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once __DIR__ . "/_prepend.php";
3
+require_once __DIR__."/_prepend.php";
4 4
 
5 5
 use PhpXmlRpc\Encoder;
6 6
 use PhpXmlRpc\Client;
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         $handles = array();
26 26
         $curl = curl_multi_init();
27 27
 
28
-        foreach($requests as $k => $req) {
28
+        foreach ($requests as $k => $req) {
29 29
             $req->setDebug($this->debug);
30 30
 
31 31
             $handle = $this->prepareCurlHandle(
@@ -58,19 +58,19 @@  discard block
 block discarded – undo
58 58
         $running = 0;
59 59
         do {
60 60
             curl_multi_exec($curl, $running);
61
-        } while($running > 0);
61
+        } while ($running>0);
62 62
 
63 63
         $responses = array();
64
-        foreach($handles as $k => $h) {
64
+        foreach ($handles as $k => $h) {
65 65
             $responses[$k] = curl_multi_getcontent($handles[$k]);
66 66
 
67
-            if ($this->debug > 1) {
67
+            if ($this->debug>1) {
68 68
                 $message = "---CURL INFO---\n";
69 69
                 foreach (curl_getinfo($h) as $name => $val) {
70 70
                     if (is_array($val)) {
71 71
                         $val = implode("\n", $val);
72 72
                     }
73
-                    $message .= $name . ': ' . $val . "\n";
73
+                    $message .= $name.': '.$val."\n";
74 74
                 }
75 75
                 $message .= '---END---';
76 76
                 $this->getLogger()->debugMessage($message);
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
         }
82 82
         curl_multi_close($curl);
83 83
 
84
-        foreach($responses as $k => $resp) {
84
+        foreach ($responses as $k => $resp) {
85 85
             if (!$resp) {
86
-                $responses[$k] = new Response(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'] . ': ' . curl_error($curl));
86
+                $responses[$k] = new Response(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'].': '.curl_error($curl));
87 87
             } else {
88 88
                 $responses[$k] = $requests[$k]->parseResponse($resp, true, $this->return_type);
89 89
             }
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 $value = $encoder->encode($data, array('auto_dates'));
101 101
 $req = new Request('interopEchoTests.echoValue', array($value));
102 102
 $reqs = array();
103
-for ($i = 0; $i < $num_tests; $i++) {
103
+for ($i = 0; $i<$num_tests; $i++) {
104 104
     $reqs[] = $req;
105 105
 }
106 106
 
@@ -109,18 +109,18 @@  discard block
 block discarded – undo
109 109
 
110 110
 $t = microtime(true);
111 111
 $resp = $client->send($reqs);
112
-$t = microtime(true) - $t;
112
+$t = microtime(true)-$t;
113 113
 echo "Sequential send: $t secs\n";
114 114
 
115 115
 $t = microtime(true);
116 116
 $resp = $client->sendParallel($reqs);
117
-$t = microtime(true) - $t;
117
+$t = microtime(true)-$t;
118 118
 echo "Parallel send: $t secs\n";
119 119
 
120 120
 $client->no_multicall = false;
121 121
 $t = microtime(true);
122 122
 $resp = $client->send($reqs);
123
-$t = microtime(true) - $t;
123
+$t = microtime(true)-$t;
124 124
 echo "Multicall send: $t secs\n";
125 125
 
126
-require_once __DIR__ . "/_append.php";
126
+require_once __DIR__."/_append.php";
Please login to merge, or discard this patch.
demo/client/agesort.php 1 patch
Spacing   +9 added lines, -9 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>
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 $inAr = array("Dave" => 24, "Edd" => 45, "Joe" => 37, "Fred" => 27);
14 14
 output("This is the input data:<br/><pre>");
15 15
 foreach ($inAr as $key => $val) {
16
-    output($key . ", " . $val . "\n");
16
+    output($key.", ".$val."\n");
17 17
 }
18 18
 output("</pre>");
19 19
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     );
30 30
 }
31 31
 $v = new PhpXmlRpc\Value($p, "array");
32
-output("Encoded into xmlrpc format it looks like this: <pre>\n" . htmlentities($v->serialize()) . "</pre>\n");
32
+output("Encoded into xmlrpc format it looks like this: <pre>\n".htmlentities($v->serialize())."</pre>\n");
33 33
 
34 34
 // create client and message objects
35 35
 $req = new PhpXmlRpc\Request('examples.sortByAge', array($v));
@@ -49,17 +49,17 @@  discard block
 block discarded – undo
49 49
     foreach ($value as $struct) {
50 50
         $name = $struct["name"];
51 51
         $age = $struct["age"];
52
-        output(htmlspecialchars($name->scalarval()) . ", " . htmlspecialchars($age->scalarval()) . "\n");
52
+        output(htmlspecialchars($name->scalarval()).", ".htmlspecialchars($age->scalarval())."\n");
53 53
     }
54 54
 
55
-    output("<hr/>For nerds: I got this value back<br/><pre>" .
56
-        htmlentities($resp->serialize()) . "</pre><hr/>\n");
55
+    output("<hr/>For nerds: I got this value back<br/><pre>".
56
+        htmlentities($resp->serialize())."</pre><hr/>\n");
57 57
 } else {
58 58
     output("An error occurred:<pre>");
59
-    output("Code: " . htmlspecialchars($resp->faultCode()) .
60
-        "\nReason: '" . htmlspecialchars($resp->faultString()) . '\'</pre><hr/>');
59
+    output("Code: ".htmlspecialchars($resp->faultCode()).
60
+        "\nReason: '".htmlspecialchars($resp->faultString()).'\'</pre><hr/>');
61 61
 }
62 62
 
63 63
 output("</body></html>\n");
64 64
 
65
-require_once __DIR__ . "/_append.php";
65
+require_once __DIR__."/_append.php";
Please login to merge, or discard this patch.
demo/client/wrap.php 1 patch
Spacing   +5 added lines, -5 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 - Webservice wrappper demo</title></head>
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 $client->return_type = 'phpvals'; // let client give us back php values instead of xmlrpcvals
21 21
 $resp = $client->send(new PhpXmlRpc\Request('system.listMethods'));
22 22
 if ($resp->faultCode()) {
23
-    output("<p>Server methods list could not be retrieved: error {$resp->faultCode()} '" . htmlspecialchars($resp->faultString()) . "'</p>\n");
23
+    output("<p>Server methods list could not be retrieved: error {$resp->faultCode()} '".htmlspecialchars($resp->faultString())."'</p>\n");
24 24
 } else {
25 25
     output("<p>Server methods list retrieved, now wrapping it up...</p>\n<ul>\n");
26 26
     flush();
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
         if ($methodName == 'examples.getStateName') {
33 33
             $callable = $wrapper->wrapXmlrpcMethod($client, $methodName);
34 34
             if ($callable) {
35
-                output("<li>Remote server method " . htmlspecialchars($methodName) . " wrapped into php function</li>\n");
35
+                output("<li>Remote server method ".htmlspecialchars($methodName)." wrapped into php function</li>\n");
36 36
             } else {
37
-                output("<li>Remote server method " . htmlspecialchars($methodName) . " could not be wrapped!</li>\n");
37
+                output("<li>Remote server method ".htmlspecialchars($methodName)." could not be wrapped!</li>\n");
38 38
             }
39 39
             break;
40 40
         }
@@ -53,4 +53,4 @@  discard block
 block discarded – undo
53 53
 
54 54
 output("</body></html>\n");
55 55
 
56
-require_once __DIR__ . "/_append.php";
56
+require_once __DIR__."/_append.php";
Please login to merge, or discard this patch.
demo/client/_prepend.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 error_reporting(E_ALL);
15 15
 
16 16
 // Use the custom class autoloader. These two lines not needed when the phpxmlrpc library is installed using Composer
17
-include_once __DIR__ . '/../../src/Autoloader.php';
17
+include_once __DIR__.'/../../src/Autoloader.php';
18 18
 PhpXmlRpc\Autoloader::register();
19 19
 
20 20
 // Let unit tests run against localhost, 'plain' demos against a known public server
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         chmod($GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'], 0777);
34 34
     }
35 35
 
36
-    include_once __DIR__ . "/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php";
36
+    include_once __DIR__."/../../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/prepend.php";
37 37
 }
38 38
 
39 39
 // A helper for cli vs we output:
Please login to merge, or discard this patch.
demo/client/which.php 1 patch
Spacing   +7 added lines, -7 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 - Which toolkit demo</title></head>
@@ -18,16 +18,16 @@  discard block
 block discarded – undo
18 18
     $value = $encoder->decode($resp->value());
19 19
     output("Toolkit info:<br/>\n");
20 20
     output("<pre>");
21
-    output("name: " . htmlspecialchars($value["toolkitName"]) . "\n");
22
-    output("version: " . htmlspecialchars($value["toolkitVersion"]) . "\n");
23
-    output("docs: " . htmlspecialchars($value["toolkitDocsUrl"]) . "\n");
24
-    output("os: " . htmlspecialchars($value["toolkitOperatingSystem"]) . "\n");
21
+    output("name: ".htmlspecialchars($value["toolkitName"])."\n");
22
+    output("version: ".htmlspecialchars($value["toolkitVersion"])."\n");
23
+    output("docs: ".htmlspecialchars($value["toolkitDocsUrl"])."\n");
24
+    output("os: ".htmlspecialchars($value["toolkitOperatingSystem"])."\n");
25 25
     output("</pre>");
26 26
 } else {
27 27
     output("An error occurred: ");
28
-    output("Code: " . htmlspecialchars($resp->faultCode()) . " Reason: '" . htmlspecialchars($resp->faultString()) . "'\n");
28
+    output("Code: ".htmlspecialchars($resp->faultCode())." Reason: '".htmlspecialchars($resp->faultString())."'\n");
29 29
 }
30 30
 
31 31
 output("</body></html>\n");
32 32
 
33
-require_once __DIR__ . "/_append.php";
33
+require_once __DIR__."/_append.php";
Please login to merge, or discard this patch.
demo/client/introspect.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once __DIR__ . "/_prepend.php";
3
+require_once __DIR__."/_prepend.php";
4 4
 
5 5
 output('<html lang="en">
6 6
 <head><title>xmlrpc - Introspect demo</title></head>
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
 function display_error($r)
15 15
 {
16 16
     output("An error occurred: ");
17
-    output("Code: " . $r->faultCode() . " Reason: '" . $r->faultString() . "'<br/>");
17
+    output("Code: ".$r->faultCode()." Reason: '".$r->faultString()."'<br/>");
18 18
 }
19 19
 
20 20
 $client = new PhpXmlRpc\Client(XMLRPCSERVER);
21 21
 
22 22
 // First off, let's retrieve the list of methods available on the remote server
23
-output("<h3>methods available at http://" . $client->server . $client->path . "</h3>\n");
23
+output("<h3>methods available at http://".$client->server.$client->path."</h3>\n");
24 24
 $req = new PhpXmlRpc\Request('system.listMethods');
25 25
 $resp = $client->send($req);
26 26
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
     // Then, retrieve the signature and help text of each available method
33 33
     foreach ($v as $methodName) {
34
-        output("<h4>" . $methodName->scalarval() . "</h4>\n");
34
+        output("<h4>".$methodName->scalarval()."</h4>\n");
35 35
         // build messages first, add params later
36 36
         $m1 = new PhpXmlRpc\Request('system.methodHelp');
37 37
         $m2 = new PhpXmlRpc\Request('system.methodSignature');
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
             if ($val->kindOf() == "array") {
63 63
                 foreach ($val as $x) {
64 64
                     $ret = $x[0];
65
-                    output("<code>" . htmlspecialchars($ret->scalarval()) . " "
66
-                        . htmlspecialchars($methodName->scalarval()) . "(");
67
-                    if ($x->count() > 1) {
68
-                        for ($k = 1; $k < $x->count(); $k++) {
65
+                    output("<code>".htmlspecialchars($ret->scalarval())." "
66
+                        . htmlspecialchars($methodName->scalarval())."(");
67
+                    if ($x->count()>1) {
68
+                        for ($k = 1; $k<$x->count(); $k++) {
69 69
                             $y = $x[$k];
70 70
                             output(htmlspecialchars($y->scalarval()));
71
-                            if ($k < $x->count() - 1) {
71
+                            if ($k<$x->count()-1) {
72 72
                                 output(", ");
73 73
                             }
74 74
                         }
@@ -85,4 +85,4 @@  discard block
 block discarded – undo
85 85
 
86 86
 output("</body></html>\n");
87 87
 
88
-require_once __DIR__ . "/_append.php";
88
+require_once __DIR__."/_append.php";
Please login to merge, or discard this patch.