Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 12 |
Ratio | 100 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
41 | public function extract(Context $context, Value $value, PlainExtractorDefinitionInterface $definition, ExtractorInterface $extractor) |
||
42 | { |
||
43 | foreach ($this->extractors as $plain_extractor) { |
||
44 | try { |
||
45 | return $plain_extractor->extract($context, $value, $definition, $extractor); |
||
46 | } catch (ExtractorException $e) { |
||
47 | // |
||
48 | } |
||
49 | } |
||
50 | |||
51 | throw new ExtractorException('Unable to pick proper extractor for ' . $value->typeOf()->value() . 'type'); |
||
52 | } |
||
53 | } |
||
54 |
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.