@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | $snv = $sno->scalarval(); |
| 54 | 54 | |
| 55 | 55 | // look it up in our array (zero-based) |
| 56 | - if (isset(self::$stateNames[$snv - 1])) { |
|
| 57 | - $stateName = self::$stateNames[$snv - 1]; |
|
| 56 | + if (isset(self::$stateNames[$snv-1])) { |
|
| 57 | + $stateName = self::$stateNames[$snv-1]; |
|
| 58 | 58 | } else { |
| 59 | 59 | // not there, so complain |
| 60 | - $err = "I don't have a state for the index '" . $snv . "'"; |
|
| 60 | + $err = "I don't have a state for the index '".$snv."'"; |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | if ($err != '') { |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $s = $req->getParam(0); |
| 132 | 132 | $t = $req->getParam(1); |
| 133 | 133 | |
| 134 | - return new Response(new Value($s->scalarval() + $t->scalarval(), Value::$xmlrpcInt)); |
|
| 134 | + return new Response(new Value($s->scalarval()+$t->scalarval(), Value::$xmlrpcInt)); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | public static $addtwodouble_sig = array(array('double', 'double', 'double')); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $s = $req->getParam(0); |
| 142 | 142 | $t = $req->getParam(1); |
| 143 | 143 | |
| 144 | - return new Response(new Value($s->scalarval() + $t->scalarval(), Value::$xmlrpcDouble)); |
|
| 144 | + return new Response(new Value($s->scalarval()+$t->scalarval(), Value::$xmlrpcDouble)); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | public static $stringecho_sig = array(array('string', 'string')); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | function echoBack($req) |
| 158 | 158 | { |
| 159 | 159 | // just sends back a string with what I got sent to me, that's all (escaping for xml is automatic) |
| 160 | - $s = "I got the following message:\n" . $req->serialize(); |
|
| 160 | + $s = "I got the following message:\n".$req->serialize(); |
|
| 161 | 161 | |
| 162 | 162 | return new Response(new Value($s)); |
| 163 | 163 | } |
@@ -230,17 +230,17 @@ discard block |
||
| 230 | 230 | |
| 231 | 231 | /// @todo in real life, we should check for presence of return characters to avoid header injection! |
| 232 | 232 | |
| 233 | - $msgHdr = "From: " . $mFrom->scalarval() . "\n"; |
|
| 234 | - $msgHdr .= "To: " . $mTo->scalarval() . "\n"; |
|
| 233 | + $msgHdr = "From: ".$mFrom->scalarval()."\n"; |
|
| 234 | + $msgHdr .= "To: ".$mTo->scalarval()."\n"; |
|
| 235 | 235 | |
| 236 | 236 | if ($mCc->scalarval() != "") { |
| 237 | - $msgHdr .= "Cc: " . $mCc->scalarval() . "\n"; |
|
| 237 | + $msgHdr .= "Cc: ".$mCc->scalarval()."\n"; |
|
| 238 | 238 | } |
| 239 | 239 | if ($mBcc->scalarval() != "") { |
| 240 | - $msgHdr .= "Bcc: " . $mBcc->scalarval() . "\n"; |
|
| 240 | + $msgHdr .= "Bcc: ".$mBcc->scalarval()."\n"; |
|
| 241 | 241 | } |
| 242 | 242 | if ($mMime->scalarval() != "") { |
| 243 | - $msgHdr .= "Content-type: " . $mMime->scalarval() . "\n"; |
|
| 243 | + $msgHdr .= "Content-type: ".$mMime->scalarval()."\n"; |
|
| 244 | 244 | } |
| 245 | 245 | $msgHdr .= "X-Mailer: XML-RPC for PHP mailer 1.0"; |
| 246 | 246 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $moe = $sno["moe"]; |
| 37 | 37 | $larry = $sno["larry"]; |
| 38 | 38 | $curly = $sno["curly"]; |
| 39 | - $num = $moe->scalarval() + $larry->scalarval() + $curly->scalarval(); |
|
| 39 | + $num = $moe->scalarval()+$larry->scalarval()+$curly->scalarval(); |
|
| 40 | 40 | |
| 41 | 41 | return new Response(new Value($num, Value::$xmlrpcInt)); |
| 42 | 42 | } |
@@ -78,9 +78,9 @@ discard block |
||
| 78 | 78 | $ar = $req->getParam(0); |
| 79 | 79 | $sz = $ar->count(); |
| 80 | 80 | $first = $ar[0]; |
| 81 | - $last = $ar[$sz - 1]; |
|
| 81 | + $last = $ar[$sz-1]; |
|
| 82 | 82 | |
| 83 | - return new Response(new Value($first->scalarval() . $last->scalarval(), Value::$xmlrpcString)); |
|
| 83 | + return new Response(new Value($first->scalarval().$last->scalarval(), Value::$xmlrpcString)); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | $v1_simpleStructReturn_sig = array(array(Value::$xmlrpcStruct, Value::$xmlrpcInt)); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $larry = $fools["larry"]; |
| 114 | 114 | $moe = $fools["moe"]; |
| 115 | 115 | |
| 116 | - return new Response(new Value($curly->scalarval() + $larry->scalarval() + $moe->scalarval(), Value::$xmlrpcInt)); |
|
| 116 | + return new Response(new Value($curly->scalarval()+$larry->scalarval()+$moe->scalarval(), Value::$xmlrpcInt)); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | $v1_countTheEntities_sig = array(array(Value::$xmlrpcStruct, Value::$xmlrpcString)); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $ap = 0; |
| 128 | 128 | $qu = 0; |
| 129 | 129 | $amp = 0; |
| 130 | - for ($i = 0; $i < strlen($str); $i++) { |
|
| 130 | + for ($i = 0; $i<strlen($str); $i++) { |
|
| 131 | 131 | $c = substr($str, $i, 1); |
| 132 | 132 | switch ($c) { |
| 133 | 133 | case ">": |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | |
| 92 | 92 | // Greek word 'kosme'. NB: NOT a valid ISO8859 string! |
| 93 | 93 | // NB: we can only register this when setting internal encoding to UTF-8, or it will break system.listMethods |
| 94 | - "tests.utf8methodname." . 'κόσμε' => array( |
|
| 94 | + "tests.utf8methodname.".'κόσμε' => array( |
|
| 95 | 95 | "function" => "exampleMethods::stringEcho", |
| 96 | 96 | "signature" => exampleMethods::$stringecho_sig, |
| 97 | 97 | "docstring" => exampleMethods::$stringecho_doc, |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | function plain_findstate($stateNo) |
| 28 | 28 | { |
| 29 | - if (isset(exampleMethods::$stateNames[$stateNo - 1])) { |
|
| 29 | + if (isset(exampleMethods::$stateNames[$stateNo - 1])) { |
|
| 30 | 30 | return exampleMethods::$stateNames[$stateNo - 1]; |
| 31 | 31 | } else { |
| 32 | 32 | // not, there so complain |
@@ -26,11 +26,11 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | function plain_findstate($stateNo) |
| 28 | 28 | { |
| 29 | - if (isset(exampleMethods::$stateNames[$stateNo - 1])) { |
|
| 30 | - return exampleMethods::$stateNames[$stateNo - 1]; |
|
| 29 | + if (isset(exampleMethods::$stateNames[$stateNo-1])) { |
|
| 30 | + return exampleMethods::$stateNames[$stateNo-1]; |
|
| 31 | 31 | } else { |
| 32 | 32 | // not, there so complain |
| 33 | - throw new Exception("I don't have a state for the index '" . $stateNo . "'", PhpXmlRpc\PhpXmlRpc::$xmlrpcerruser); |
|
| 33 | + throw new Exception("I don't have a state for the index '".$stateNo."'", PhpXmlRpc\PhpXmlRpc::$xmlrpcerruser); |
|
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | |
@@ -124,13 +124,13 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | $findstate10_sig = array( |
| 126 | 126 | /// @todo add a demo and test with closure usage |
| 127 | - "function" => function ($req) { return exampleMethods::findState($req); }, |
|
| 127 | + "function" => function($req) { return exampleMethods::findState($req); }, |
|
| 128 | 128 | "signature" => array(array(Value::$xmlrpcString, Value::$xmlrpcInt)), |
| 129 | - "docstring" => 'When passed an integer between 1 and 51 returns the name of a US state, where the integer is the ' . |
|
| 129 | + "docstring" => 'When passed an integer between 1 and 51 returns the name of a US state, where the integer is the '. |
|
| 130 | 130 | 'index of that state name in an alphabetic order.', |
| 131 | 131 | ); |
| 132 | 132 | |
| 133 | -$findstate11_sig = $wrapper->wrapPhpFunction(function ($stateNo) { return plain_findstate($stateNo); }); |
|
| 133 | +$findstate11_sig = $wrapper->wrapPhpFunction(function($stateNo) { return plain_findstate($stateNo); }); |
|
| 134 | 134 | |
| 135 | 135 | /// @todo do we really need a new instance ? |
| 136 | 136 | $c = new handlersContainer(); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | $namespaceSignatures = $wrapper->wrapPhpClass($c, array('prefix' => 'namespacetest.', 'replace_class_name' => true, 'method_filter' => '/^findState$/', 'method_type' => 'static')); |
| 141 | 141 | |
| 142 | -$returnObj_sig = $wrapper->wrapPhpFunction(array($c, 'returnObject'), '', array('encode_php_objs' => true)); |
|
| 142 | +$returnObj_sig = $wrapper->wrapPhpFunction(array($c, 'returnObject'), '', array('encode_php_objs' => true)); |
|
| 143 | 143 | |
| 144 | 144 | return array_merge( |
| 145 | 145 | array( |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | * `$functions_parameters_type` and `$exception_handling` |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -require_once __DIR__ . "/_prepend.php"; |
|
| 12 | +require_once __DIR__."/_prepend.php"; |
|
| 13 | 13 | |
| 14 | 14 | use PhpXmlRpc\Response; |
| 15 | 15 | use PhpXmlRpc\Server; |
@@ -94,12 +94,12 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | $addComment_sig = array(array(Value::$xmlrpcInt, Value::$xmlrpcString, Value::$xmlrpcString, Value::$xmlrpcString)); |
| 96 | 96 | |
| 97 | -$addComment_doc = 'Adds a comment to an item. The first parameter is the item ID, the second the name of the commenter, ' . |
|
| 97 | +$addComment_doc = 'Adds a comment to an item. The first parameter is the item ID, the second the name of the commenter, '. |
|
| 98 | 98 | 'and the third is the comment itself. Returns the number of comments against that ID.'; |
| 99 | 99 | |
| 100 | 100 | $getComments_sig = array(array(Value::$xmlrpcArray, Value::$xmlrpcString)); |
| 101 | 101 | |
| 102 | -$getComments_doc = 'Returns an array of comments for a given ID, which is the sole argument. Each array item is a struct ' . |
|
| 102 | +$getComments_doc = 'Returns an array of comments for a given ID, which is the sole argument. Each array item is a struct '. |
|
| 103 | 103 | 'containing name and comment text.'; |
| 104 | 104 | |
| 105 | 105 | $srv = new Server(array( |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * Please _do not_ copy this file verbatim into your production server. |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -require_once __DIR__ . "/_prepend.php"; |
|
| 13 | +require_once __DIR__."/_prepend.php"; |
|
| 14 | 14 | |
| 15 | 15 | use PhpXmlRpc\PhpXmlRpc; |
| 16 | 16 | use PhpXmlRpc\Server; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | } elseif ($_GET['FORCE_AUTH'] == 'Digest') { |
| 70 | 70 | if (empty($_SERVER['PHP_AUTH_DIGEST'])) { |
| 71 | 71 | header('HTTP/1.1 401 Unauthorized'); |
| 72 | - header('WWW-Authenticate: Digest realm="Phpxmlrpc Digest Realm",qop="auth",nonce="' . uniqid() . '",opaque="' . md5('Phpxmlrpc Digest Realm') . '"'); |
|
| 72 | + header('WWW-Authenticate: Digest realm="Phpxmlrpc Digest Realm",qop="auth",nonce="'.uniqid().'",opaque="'.md5('Phpxmlrpc Digest Realm').'"'); |
|
| 73 | 73 | die('Text visible if user hits Cancel button'); |
| 74 | 74 | } |
| 75 | 75 | } |