Conditions | 3 |
Paths | 2 |
Total Lines | 9 |
Lines | 9 |
Ratio | 100 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
23 | 4 | View Code Duplication | public function onImportPrepare(ImportProcessEvent $event) |
24 | { |
||
25 | //merge converter only works if context is an array |
||
26 | 4 | if (!($event->getContext() instanceof Import) || !is_array($event->getContext()->getRun()->getContext())) { |
|
27 | 3 | return; |
|
28 | } |
||
29 | |||
30 | 1 | $this->currentContext = $event->getContext()->getRun()->getContext(); |
|
31 | 1 | } |
|
32 | |||
50 |
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.