| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 31 | public function extract(Context $context, Value $value, PlainExtractorDefinitionInterface $definition, ExtractorInterface $extractor) |
||
| 32 | { |
||
| 33 | if ($definition->getNext()) { |
||
| 34 | // we have a type constraint on raw value here, so regards that we return raw value, |
||
| 35 | // we will try to extract it just to ensure constrain validity |
||
| 36 | try { |
||
| 37 | $extractor->extract($context, $value, $definition->getNext()); |
||
| 38 | } catch (ExtractorException $e) { |
||
| 39 | throw new ExtractorException('Raw value constraint failed: ' . $e->getMessage()); |
||
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 43 | return $value; |
||
| 44 | } |
||
| 45 | } |
||
| 46 |