Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 8 |
Ratio | 100 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
45 | public function extract(Context $context, Value $value, PlainExtractorDefinitionInterface $definition, ExtractorInterface $extractor) |
||
46 | { |
||
47 | if ($value instanceof ArrayObject) { |
||
48 | return $this->extractor->extract($context, $value, $definition, $extractor); |
||
49 | } |
||
50 | |||
51 | throw new ExtractorException('Value must be of array type, ' . $value->typeOf()->value() . ' given instead'); |
||
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.