| Total Complexity | 3 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class ArrayMethodResolver implements MethodResolverInterface |
||
| 11 | { |
||
| 12 | /** @var JsonRpcMethodInterface[] */ |
||
| 13 | private $methodList = []; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * {@inheritdoc} |
||
| 17 | */ |
||
| 18 | 2 | public function resolve(string $methodName) |
|
| 19 | { |
||
| 20 | 2 | return array_key_exists($methodName, $this->methodList) |
|
| 21 | 1 | ? $this->methodList[$methodName] |
|
| 22 | 2 | : null |
|
| 23 | ; |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param JsonRpcMethodInterface $method |
||
| 28 | * @param string $methodName |
||
| 29 | * |
||
| 30 | * @return ArrayMethodResolver |
||
| 31 | */ |
||
| 32 | 2 | public function addMethod(JsonRpcMethodInterface $method, string $methodName) : ArrayMethodResolver |
|
| 37 | } |
||
| 38 | } |
||
| 39 |