| Conditions | 3 |
| Paths | 3 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3.0416 |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | 1 | public function getItem(string $resourceClass, $id, string $operationName = null, array $context = []) |
|
| 47 | { |
||
| 48 | 1 | $manager = $this->managerRegistry->getManagerForClass($resourceClass); |
|
| 49 | 1 | if (null === $manager) { |
|
| 50 | return null; |
||
| 51 | } |
||
| 52 | 1 | $repository = $manager->getRepository($resourceClass); |
|
| 53 | 1 | return $id === 'default' ? $repository->findOneBy(['default' => true]) : $repository->find($id); |
|
| 54 | } |
||
| 56 |