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