| Total Complexity | 3 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class DefaultMethodResolver implements MethodResolverInterface |
||
| 12 | { |
||
| 13 | /** @var JsonRpcMethodInterface[] */ |
||
| 14 | private $methodList = []; |
||
| 15 | /** |
||
| 16 | * {@inheritdoc} |
||
| 17 | */ |
||
| 18 | public function resolve(string $methodName) : JsonRpcMethodInterface |
||
| 19 | { |
||
| 20 | // TODO: Implement resolve() method. |
||
| 21 | if (!isset($this->methodList[$methodName])) { |
||
| 22 | throw new JsonRpcMethodNotFoundException($methodName); |
||
| 23 | } |
||
| 24 | |||
| 25 | return $this->methodList[$methodName]; |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @param string $methodName |
||
| 30 | * @param JsonRpcMethodInterface $method |
||
| 31 | */ |
||
| 32 | public function addMethod(string $methodName, JsonRpcMethodInterface $method) |
||
| 35 | } |
||
| 36 | } |
||
| 37 |