| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | protected function getEntity(): EntityInterface |
||
| 17 | { |
||
| 18 | $entity = $this->context->getObject(); |
||
| 19 | if ($entity instanceof EntityInterface) { |
||
| 20 | return $entity; |
||
| 21 | } |
||
| 22 | throw new RuntimeException( |
||
| 23 | 'The object being validated is not an Entity, it is an instance of ' . get_class($entity) |
||
| 24 | ); |
||
| 27 |