Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
26 | public function execute(Request $request) : ArtifactCollection |
||
27 | { |
||
28 | /** @var \ReflectionClass $reflection */ |
||
29 | $reflection = $this->getArtifact('reflection'); |
||
30 | $entity = $this->doctrine->getRepository($reflection->getName())->find($request->get('id', 0)); |
||
31 | |||
32 | if (!$entity) { |
||
33 | throw new NotFoundHttpException('Resource not found'); |
||
34 | } |
||
35 | |||
36 | return new ArtifactCollection([ |
||
37 | new Artifact('entity', $entity) |
||
38 | ]); |
||
46 | } |