Passed
Push — master ( 24898d...721548 )
by Gaetano
08:06
created
src/Value.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                     $this->me['struct'] = $val;
97 97
                     break;
98 98
                 default:
99
-                    $this->getLogger()->error("XML-RPC: " . __METHOD__ . ": not a known type ($type)");
99
+                    $this->getLogger()->error("XML-RPC: ".__METHOD__.": not a known type ($type)");
100 100
             }
101 101
         }
102 102
     }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         }
127 127
 
128 128
         if ($typeOf !== 1) {
129
-            $this->getLogger()->error("XML-RPC: " . __METHOD__ . ": not a scalar type ($type)");
129
+            $this->getLogger()->error("XML-RPC: ".__METHOD__.": not a scalar type ($type)");
130 130
             return 0;
131 131
         }
132 132
 
@@ -143,10 +143,10 @@  discard block
 block discarded – undo
143 143
 
144 144
         switch ($this->mytype) {
145 145
             case 1:
146
-                $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': scalar xmlrpc value can have only one value');
146
+                $this->getLogger()->error('XML-RPC: '.__METHOD__.': scalar xmlrpc value can have only one value');
147 147
                 return 0;
148 148
             case 3:
149
-                $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': cannot add anonymous scalar to struct xmlrpc value');
149
+                $this->getLogger()->error('XML-RPC: '.__METHOD__.': cannot add anonymous scalar to struct xmlrpc value');
150 150
                 return 0;
151 151
             case 2:
152 152
                 // we're adding a scalar value to an array here
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
             return 1;
192 192
         } else {
193
-            $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': already initialized as a [' . $this->kindOf() . ']');
193
+            $this->getLogger()->error('XML-RPC: '.__METHOD__.': already initialized as a ['.$this->kindOf().']');
194 194
             return 0;
195 195
         }
196 196
     }
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 
222 222
             return 1;
223 223
         } else {
224
-            $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': already initialized as a [' . $this->kindOf() . ']');
224
+            $this->getLogger()->error('XML-RPC: '.__METHOD__.': already initialized as a ['.$this->kindOf().']');
225 225
             return 0;
226 226
         }
227 227
     }
@@ -265,19 +265,19 @@  discard block
 block discarded – undo
265 265
             case 1:
266 266
                 switch ($typ) {
267 267
                     case static::$xmlrpcBase64:
268
-                        $rs .= "<{$typ}>" . base64_encode($val) . "</{$typ}>";
268
+                        $rs .= "<{$typ}>".base64_encode($val)."</{$typ}>";
269 269
                         break;
270 270
                     case static::$xmlrpcBoolean:
271
-                        $rs .= "<{$typ}>" . ($val ? '1' : '0') . "</{$typ}>";
271
+                        $rs .= "<{$typ}>".($val ? '1' : '0')."</{$typ}>";
272 272
                         break;
273 273
                     case static::$xmlrpcString:
274 274
                         // Do NOT use htmlentities, since it will produce named html entities, which are invalid xml
275
-                        $rs .= "<{$typ}>" . $this->getCharsetEncoder()->encodeEntities($val, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</{$typ}>";
275
+                        $rs .= "<{$typ}>".$this->getCharsetEncoder()->encodeEntities($val, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</{$typ}>";
276 276
                         break;
277 277
                     case static::$xmlrpcInt:
278 278
                     case static::$xmlrpcI4:
279 279
                     case static::$xmlrpcI8:
280
-                        $rs .= "<{$typ}>" . (int)$val . "</{$typ}>";
280
+                        $rs .= "<{$typ}>".(int) $val."</{$typ}>";
281 281
                         break;
282 282
                     case static::$xmlrpcDouble:
283 283
                         // avoid using standard conversion of float to string because it is locale-dependent,
@@ -285,16 +285,16 @@  discard block
 block discarded – undo
285 285
                         // sprintf('%F') could be most likely ok, but it fails e.g. on 2e-14.
286 286
                         // The code below tries its best at keeping max precision while avoiding exp notation,
287 287
                         // but there is of course no limit in the number of decimal places to be used...
288
-                        $rs .= "<{$typ}>" . preg_replace('/\\.?0+$/', '', number_format((double)$val, PhpXmlRpc::$xmlpc_double_precision, '.', '')) . "</{$typ}>";
288
+                        $rs .= "<{$typ}>".preg_replace('/\\.?0+$/', '', number_format((double) $val, PhpXmlRpc::$xmlpc_double_precision, '.', ''))."</{$typ}>";
289 289
                         break;
290 290
                     case static::$xmlrpcDateTime:
291 291
                         if (is_string($val)) {
292 292
                             $rs .= "<{$typ}>{$val}</{$typ}>";
293 293
                         // DateTimeInterface is not present in php 5.4...
294 294
                         } elseif (is_a($val, 'DateTimeInterface') || is_a($val, 'DateTime')) {
295
-                            $rs .= "<{$typ}>" . $val->format('Ymd\TH:i:s') . "</{$typ}>";
295
+                            $rs .= "<{$typ}>".$val->format('Ymd\TH:i:s')."</{$typ}>";
296 296
                         } elseif (is_int($val)) {
297
-                            $rs .= "<{$typ}>" . date('Ymd\TH:i:s', $val) . "</{$typ}>";
297
+                            $rs .= "<{$typ}>".date('Ymd\TH:i:s', $val)."</{$typ}>";
298 298
                         } else {
299 299
                             // not really a good idea here: but what should we output anyway? left for backward compat...
300 300
                             $rs .= "<{$typ}>{$val}</{$typ}>";
@@ -316,14 +316,14 @@  discard block
 block discarded – undo
316 316
             case 3:
317 317
                 // struct
318 318
                 if ($this->_php_class) {
319
-                    $rs .= '<struct php_class="' . $this->_php_class . "\">\n";
319
+                    $rs .= '<struct php_class="'.$this->_php_class."\">\n";
320 320
                 } else {
321 321
                     $rs .= "<struct>\n";
322 322
                 }
323 323
                 $charsetEncoder = $this->getCharsetEncoder();
324 324
                 /** @var Value $val2 */
325 325
                 foreach ($val as $key2 => $val2) {
326
-                    $rs .= '<member><name>' . $charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</name>\n";
326
+                    $rs .= '<member><name>'.$charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</name>\n";
327 327
                     //$rs.=$this->serializeval($val2);
328 328
                     $rs .= $val2->serialize($charsetEncoding);
329 329
                     $rs .= "</member>\n";
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
         $val = reset($this->me);
359 359
         $typ = key($this->me);
360 360
 
361
-        return '<value>' . $this->serializeData($typ, $val, $charsetEncoding) . "</value>\n";
361
+        return '<value>'.$this->serializeData($typ, $val, $charsetEncoding)."</value>\n";
362 362
     }
363 363
 
364 364
     /**
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
      */
374 374
     public function structMemExists($key)
375 375
     {
376
-        $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated');
376
+        $this->logDeprecation('Method '.__METHOD__.' is deprecated');
377 377
 
378 378
         return array_key_exists($key, $this->me['struct']);
379 379
     }
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
      */
390 390
     public function structMem($key)
391 391
     {
392
-        $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated');
392
+        $this->logDeprecation('Method '.__METHOD__.' is deprecated');
393 393
 
394 394
         return $this->me['struct'][$key];
395 395
     }
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
      */
403 403
     public function structReset()
404 404
     {
405
-        $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated');
405
+        $this->logDeprecation('Method '.__METHOD__.' is deprecated');
406 406
 
407 407
         reset($this->me['struct']);
408 408
     }
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
      */
418 418
     public function structEach()
419 419
     {
420
-        $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated');
420
+        $this->logDeprecation('Method '.__METHOD__.' is deprecated');
421 421
 
422 422
         return @each($this->me['struct']);
423 423
     }
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
      */
463 463
     public function arrayMem($key)
464 464
     {
465
-        $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated');
465
+        $this->logDeprecation('Method '.__METHOD__.' is deprecated');
466 466
 
467 467
         return $this->me['array'][$key];
468 468
     }
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
      */
477 477
     public function arraySize()
478 478
     {
479
-        $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated');
479
+        $this->logDeprecation('Method '.__METHOD__.' is deprecated');
480 480
 
481 481
         return count($this->me['array']);
482 482
     }
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
      */
491 491
     public function structSize()
492 492
     {
493
-        $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated');
493
+        $this->logDeprecation('Method '.__METHOD__.' is deprecated');
494 494
 
495 495
         return count($this->me['struct']);
496 496
     }
Please login to merge, or discard this patch.
src/Traits/DeprecationLogger.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,6 +14,6 @@
 block discarded – undo
14 14
             return;
15 15
         }
16 16
 
17
-        $this->getLogger()->warning('XML-RPC Deprecated: ' . $message);
17
+        $this->getLogger()->warning('XML-RPC Deprecated: '.$message);
18 18
     }
19 19
 }
Please login to merge, or discard this patch.