Completed
Push — master ( 52f4ed...808c26 )
by Marco
02:51
created
src/RpcMethod.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
     /**
171 171
      * Get the method's method
172 172
      *
173
-     * @return string|null
173
+     * @return string
174 174
      */
175 175
     public function getDescription() {
176 176
         
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
      * Static class constructor - create an RpcMethod object
380 380
      *
381 381
      * @param string            $name
382
-     * @param string|function   $callback
382
+     * @param string   $callback
383 383
      * @param string|null       $method
384 384
      * 
385 385
      * @return \Comodojo\RpcServer\RpcMethod
Please login to merge, or discard this patch.
src/RpcServer.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
             
321 321
             $payload = $this->uncan($this->payload);
322 322
 
323
-            $this->logger->debug("Decoded payload", (array)$payload);
323
+            $this->logger->debug("Decoded payload", (array) $payload);
324 324
 
325 325
             if ( $this->protocol == self::XMLRPC ) $result = XmlProcessor::process($payload, $parameters_object, $this->logger);
326 326
             
@@ -480,30 +480,30 @@  discard block
 block discarded – undo
480 480
      */
481 481
     private static function setIntrospectionMethods($methods) {
482 482
         
483
-        $methods->add( RpcMethod::create("system.getCapabilities", "\Comodojo\RpcServer\Reserved\GetCapabilities", "execute")
483
+        $methods->add(RpcMethod::create("system.getCapabilities", "\Comodojo\RpcServer\Reserved\GetCapabilities", "execute")
484 484
             ->setDescription("This method lists all the capabilites that the RPC server has: the (more or less standard) extensions to the RPC spec that it adheres to")
485 485
             ->setReturnType('struct')
486 486
         );
487 487
         
488
-        $methods->add( RpcMethod::create("system.listMethods", "\Comodojo\RpcServer\Introspection\ListMethods", "execute")
488
+        $methods->add(RpcMethod::create("system.listMethods", "\Comodojo\RpcServer\Introspection\ListMethods", "execute")
489 489
             ->setDescription("This method lists all the methods that the RPC server knows how to dispatch")
490 490
             ->setReturnType('array')
491 491
         );
492 492
             
493
-        $methods->add( RpcMethod::create("system.methodHelp", "\Comodojo\RpcServer\Introspection\MethodHelp", "execute")
493
+        $methods->add(RpcMethod::create("system.methodHelp", "\Comodojo\RpcServer\Introspection\MethodHelp", "execute")
494 494
             ->setDescription("Returns help text if defined for the method passed, otherwise returns an empty string")
495 495
             ->setReturnType('string')
496 496
             ->addParameter('string', 'method')
497 497
         );
498 498
             
499
-        $methods->add( RpcMethod::create("system.methodSignature", "\Comodojo\RpcServer\Introspection\MethodSignature", "execute")
499
+        $methods->add(RpcMethod::create("system.methodSignature", "\Comodojo\RpcServer\Introspection\MethodSignature", "execute")
500 500
             ->setDescription("Returns an array of known signatures (an array of arrays) for the method name passed.". 
501 501
                 "If no signatures are known, returns a none-array (test for type != array to detect missing signature)")
502 502
             ->setReturnType('array')
503 503
             ->addParameter('string', 'method')
504 504
         );
505 505
         
506
-        $methods->add( RpcMethod::create("system.multicall", "\Comodojo\RpcServer\Reserved\Multicall", "execute")
506
+        $methods->add(RpcMethod::create("system.multicall", "\Comodojo\RpcServer\Reserved\Multicall", "execute")
507 507
             ->setDescription("Boxcar multiple RPC calls in one request. See http://www.xmlrpc.com/discuss/msgReader\$1208 for details")
508 508
             ->setReturnType('array')
509 509
             ->addParameter('array', 'requests')
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
             'json-rpc' => array('http://www.jsonrpc.org/specification', 2)
528 528
         );
529 529
     
530
-        foreach ($supported_capabilities as $capability => $values) {
530
+        foreach ( $supported_capabilities as $capability => $values ) {
531 531
             
532 532
             $capabilities->add($capability, $values[0], $values[1]);
533 533
 
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
             -31001 => "Recursive system.multicall forbidden"
559 559
         );
560 560
 
561
-        foreach ($std_rpc_errors as $code => $message) {
561
+        foreach ( $std_rpc_errors as $code => $message ) {
562 562
             
563 563
             $errors->add($code, $message);
564 564
 
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -566,4 +566,4 @@
 block discarded – undo
566 566
 
567 567
     }
568 568
 
569
- }
569
+    }
Please login to merge, or discard this patch.
src/Request/JsonProcessor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -468,7 +468,7 @@
 block discarded – undo
468 468
 
469 469
             $index = 0;
470 470
 
471
-            foreach ($requested as $parameter => $type) {
471
+            foreach ( $requested as $parameter => $type ) {
472 472
 
473 473
                 if ( !DataValidator::validate($type, $provided[$index]) ) return false;
474 474
 
Please login to merge, or discard this patch.
src/Request/XmlProcessor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -243,7 +243,7 @@
 block discarded – undo
243 243
 
244 244
             $index = 0;
245 245
 
246
-            foreach ($signature["PARAMETERS"] as $parameter => $type) {
246
+            foreach ( $signature["PARAMETERS"] as $parameter => $type ) {
247 247
 
248 248
                 if ( !DataValidator::validate($type, $provided_parameters[$index]) ) continue 2;
249 249
 
Please login to merge, or discard this patch.
src/Util/DataValidator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public static function validate($kind, $value) {
32 32
 
33
-        $subfunction = "self::validate".ucfirst(strtolower(str_replace(".","",$kind)));
33
+        $subfunction = "self::validate".ucfirst(strtolower(str_replace(".", "", $kind)));
34 34
 
35 35
         return call_user_func($subfunction, $value);
36 36
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
         if ( !is_array($value) ) return false;
84 84
 
85
-        return ( array() === $value || !self::validateStruct($value) );
85
+        return (array() === $value || !self::validateStruct($value));
86 86
 
87 87
     }
88 88
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
             $timestring = strtotime($value);
112 112
 
113
-            if ($timestring === false) return false;
113
+            if ( $timestring === false ) return false;
114 114
 
115 115
             return $timestring == $time;
116 116
 
Please login to merge, or discard this patch.