src/Comodojo/RpcServer/Component/Methods.php 1 location
|
@@ 115-133 (lines=19) @@
|
| 112 |
|
* @return array|RpcMethod|null |
| 113 |
|
* @TODO Verify null return in case of missing methods and, in case, handle the error condition |
| 114 |
|
*/ |
| 115 |
|
final public function get($method = null) { |
| 116 |
|
|
| 117 |
|
if ( empty($method) ) { |
| 118 |
|
|
| 119 |
|
$return = $this->rpc_methods; |
| 120 |
|
|
| 121 |
|
} else if ( array_key_exists($method, $this->rpc_methods) ) { |
| 122 |
|
|
| 123 |
|
$return = $this->rpc_methods[$method]; |
| 124 |
|
|
| 125 |
|
} else { |
| 126 |
|
|
| 127 |
|
$return = null; |
| 128 |
|
|
| 129 |
|
} |
| 130 |
|
|
| 131 |
|
return $return; |
| 132 |
|
|
| 133 |
|
} |
| 134 |
|
|
| 135 |
|
} |
| 136 |
|
|
src/Comodojo/RpcServer/Request/Parameters.php 1 location
|
@@ 253-271 (lines=19) @@
|
| 250 |
|
* |
| 251 |
|
* @return mixed |
| 252 |
|
*/ |
| 253 |
|
public function get($parameter = null) { |
| 254 |
|
|
| 255 |
|
if ( empty($parameter) ) { |
| 256 |
|
|
| 257 |
|
$return = $this->parameters; |
| 258 |
|
|
| 259 |
|
} else if ( array_key_exists($parameter, $this->parameters) ) { |
| 260 |
|
|
| 261 |
|
$return = $this->parameters[$parameter]; |
| 262 |
|
|
| 263 |
|
} else { |
| 264 |
|
|
| 265 |
|
$return = null; |
| 266 |
|
|
| 267 |
|
} |
| 268 |
|
|
| 269 |
|
return $return; |
| 270 |
|
|
| 271 |
|
} |
| 272 |
|
|
| 273 |
|
} |
| 274 |
|
|