| Conditions | 5 |
| Paths | 6 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | protected function initAnnotation( |
||
| 24 | array $values |
||
| 25 | ): void { |
||
| 26 | $accessor = PropertyAccess::createPropertyAccessor(); |
||
| 27 | |||
| 28 | $method = new ReflectionMethod($this, '__construct'); |
||
| 29 | $params = $method->getParameters(); |
||
| 30 | |||
| 31 | if (array_keys($values) === ['value']) { |
||
| 32 | $values = is_array( |
||
| 33 | $values['value'] |
||
| 34 | ) ? $values['value'] : [$values['value']]; |
||
| 35 | |||
| 36 | foreach ($values as $i => $value) { |
||
| 37 | $accessor->setValue($this, $params[$i]->getName(), $value); |
||
| 38 | } |
||
| 39 | } else { |
||
| 40 | foreach ($values as $arg => $value) { |
||
| 41 | $accessor->setValue($this, $arg, $value); |
||
| 42 | } |
||
| 46 | } |