| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 40 | 4 | public function getEntity(): object |
|
| 41 | { |
||
| 42 | 4 | $entity = $this->entityManager->getRepository($this->className)->find($this->id); |
|
| 43 | 4 | if (!$entity) { |
|
| 44 | 2 | throw new UserError('Entity not found for class `' . $this->className . '` and ID `' . $this->id . '`.'); |
|
| 45 | } |
||
| 46 | |||
| 47 | 2 | return $entity; |
|
| 48 | } |
||
| 50 |