Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | 3 | public function enhanceMethodDoc(MethodDocCreatedEvent $event) |
|
30 | { |
||
31 | 3 | $jsonRpcMethod = $event->getMethod(); |
|
32 | 3 | if ($jsonRpcMethod instanceof MethodWithValidatedParamsInterface) { |
|
33 | 2 | $paramsDoc = $this->paramDocConverter->transform($jsonRpcMethod->getParamsConstraint()); |
|
34 | |||
35 | // If method have arguments, they are required and not nullable |
||
36 | 2 | $paramsDoc->setNullable(false) |
|
37 | 2 | ->setRequired(true); |
|
38 | |||
39 | 2 | $event->getDoc()->setParamsDoc($paramsDoc); |
|
40 | } |
||
43 |