Conditions | 2 |
Paths | 2 |
Total Lines | 7 |
Lines | 7 |
Ratio | 100 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
17 | public function __invoke(ModelContainer $container, $ann) |
||
18 | { |
||
19 | $params = new AnnotationParams($ann->description, 2); |
||
20 | $table = $params->getParam(0) or \PhpBoot\abort(new AnnotationSyntaxException("The annotation \"@{$ann->name} {$ann->description}\" of {$container->getClassName()} require at least one param, 0 given")); |
||
21 | |||
22 | $container->setPk($table); |
||
23 | } |
||
24 | } |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.