| Conditions | 3 |
| Paths | 4 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3.072 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 16 | public function __invoke(ObjectDefinitionContext $context, $ann) |
|
| 24 | { |
||
| 25 | 16 | $className = $context->definition->getClassName(); |
|
| 26 | 16 | if(!$ann->parent){ |
|
| 27 | Logger::debug("The annotation \"@{$ann->name} {$ann->description}\" of $className should be used with parent"); |
||
| 28 | } |
||
| 29 | 16 | $target = $ann->parent->name; |
|
| 30 | // |
||
| 31 | 16 | $params = new AnnotationParams($ann->description, 2); |
|
| 32 | |||
| 33 | 16 | count($params)>0 or \PhpBoot\abort(new AnnotationSyntaxException("The annotation \"@{$ann->name} {$ann->description}\" of $className::$target require at least one param, 0 given")); |
|
| 34 | |||
| 35 | 16 | $context->vars[$target] = TypeHint::normalize($params[0], $className); |
|
| 36 | } |
||
| 37 | } |