@@ -566,4 +566,4 @@ |
||
566 | 566 | |
567 | 567 | } |
568 | 568 | |
569 | - } |
|
569 | + } |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | |
323 | 323 | $payload = $this->uncan($this->payload); |
324 | 324 | |
325 | - $this->logger->debug("Decoded payload", (array)$payload); |
|
325 | + $this->logger->debug("Decoded payload", (array) $payload); |
|
326 | 326 | |
327 | 327 | if ( $this->protocol == self::XMLRPC ) $result = XmlProcessor::process($payload, $parameters_object, $this->logger); |
328 | 328 | |
@@ -486,30 +486,30 @@ discard block |
||
486 | 486 | */ |
487 | 487 | private static function setIntrospectionMethods($methods) { |
488 | 488 | |
489 | - $methods->add( RpcMethod::create("system.getCapabilities", '\Comodojo\RpcServer\Reserved\GetCapabilities::execute') |
|
489 | + $methods->add(RpcMethod::create("system.getCapabilities", '\Comodojo\RpcServer\Reserved\GetCapabilities::execute') |
|
490 | 490 | ->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") |
491 | 491 | ->setReturnType('struct') |
492 | 492 | ); |
493 | 493 | |
494 | - $methods->add( RpcMethod::create("system.listMethods", '\Comodojo\RpcServer\Introspection\ListMethods::execute') |
|
494 | + $methods->add(RpcMethod::create("system.listMethods", '\Comodojo\RpcServer\Introspection\ListMethods::execute') |
|
495 | 495 | ->setDescription("This method lists all the methods that the RPC server knows how to dispatch") |
496 | 496 | ->setReturnType('array') |
497 | 497 | ); |
498 | 498 | |
499 | - $methods->add( RpcMethod::create("system.methodHelp", '\Comodojo\RpcServer\Introspection\MethodHelp::execute') |
|
499 | + $methods->add(RpcMethod::create("system.methodHelp", '\Comodojo\RpcServer\Introspection\MethodHelp::execute') |
|
500 | 500 | ->setDescription("Returns help text if defined for the method passed, otherwise returns an empty string") |
501 | 501 | ->setReturnType('string') |
502 | 502 | ->addParameter('string', 'method') |
503 | 503 | ); |
504 | 504 | |
505 | - $methods->add( RpcMethod::create("system.methodSignature", '\Comodojo\RpcServer\Introspection\MethodSignature::execute') |
|
505 | + $methods->add(RpcMethod::create("system.methodSignature", '\Comodojo\RpcServer\Introspection\MethodSignature::execute') |
|
506 | 506 | ->setDescription("Returns an array of known signatures (an array of arrays) for the method name passed.". |
507 | 507 | "If no signatures are known, returns a none-array (test for type != array to detect missing signature)") |
508 | 508 | ->setReturnType('array') |
509 | 509 | ->addParameter('string', 'method') |
510 | 510 | ); |
511 | 511 | |
512 | - $methods->add( RpcMethod::create("system.multicall", '\Comodojo\RpcServer\Reserved\Multicall::execute') |
|
512 | + $methods->add(RpcMethod::create("system.multicall", '\Comodojo\RpcServer\Reserved\Multicall::execute') |
|
513 | 513 | ->setDescription("Boxcar multiple RPC calls in one request. See http://www.xmlrpc.com/discuss/msgReader\$1208 for details") |
514 | 514 | ->setReturnType('array') |
515 | 515 | ->addParameter('array', 'requests') |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | 'json-rpc' => array('http://www.jsonrpc.org/specification', 2) |
534 | 534 | ); |
535 | 535 | |
536 | - foreach ($supported_capabilities as $capability => $values) { |
|
536 | + foreach ( $supported_capabilities as $capability => $values ) { |
|
537 | 537 | |
538 | 538 | $capabilities->add($capability, $values[0], $values[1]); |
539 | 539 | |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | -31001 => "Recursive system.multicall forbidden" |
565 | 565 | ); |
566 | 566 | |
567 | - foreach ($std_rpc_errors as $code => $message) { |
|
567 | + foreach ( $std_rpc_errors as $code => $message ) { |
|
568 | 568 | |
569 | 569 | $errors->add($code, $message); |
570 | 570 |
@@ -468,7 +468,7 @@ |
||
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 |
@@ -243,7 +243,7 @@ |
||
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 |
@@ -30,7 +30,7 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -94,8 +94,7 @@ discard block |
||
94 | 94 | * Class constructor |
95 | 95 | * |
96 | 96 | * @param string $name |
97 | - * @param mixed $callback |
|
98 | - * @param string $method |
|
97 | + * @param callable $callback |
|
99 | 98 | * |
100 | 99 | * @throws Exception |
101 | 100 | */ |
@@ -170,7 +169,7 @@ discard block |
||
170 | 169 | /** |
171 | 170 | * Get additional arguments to forward to callback |
172 | 171 | * |
173 | - * @return array |
|
172 | + * @return callable |
|
174 | 173 | */ |
175 | 174 | public function getArguments() { |
176 | 175 | |
@@ -379,8 +378,7 @@ discard block |
||
379 | 378 | * Static class constructor - create an RpcMethod object |
380 | 379 | * |
381 | 380 | * @param string $name |
382 | - * @param string|function $callback |
|
383 | - * @param string|null $method |
|
381 | + * @param string $callback |
|
384 | 382 | * |
385 | 383 | * @return RpcMethod |
386 | 384 | * @throws Exception |