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