| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | public function getSetterMethod(ReflectionMethod $method): ?SetterMethod |
||
| 34 | { |
||
| 35 | $inject = $method->getAnnotation(InjectInterface::class, ReflectionAttribute::IS_INSTANCEOF); |
||
| 36 | if (! $inject instanceof InjectInterface) { |
||
| 37 | return null; |
||
| 38 | } |
||
| 39 | |||
| 40 | $name = $this->getName($method); |
||
| 41 | $setterMethod = new SetterMethod($method, $name); |
||
| 42 | if ($inject->isOptional()) { |
||
| 43 | $setterMethod->setOptional(); |
||
| 44 | } |
||
| 45 | |||
| 46 | return $setterMethod; |
||
| 47 | } |
||
| 59 |