Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 4.125 |
Changes | 0 |
1 | <?php |
||
23 | 1 | public function find($uuid, $namespace) |
|
24 | { |
||
25 | 1 | if (! $uuid instanceof Uuid) { |
|
26 | try { |
||
27 | 1 | $uuid = Uuid::fromString($uuid); |
|
28 | 1 | } catch (InvalidArgumentException $e) { |
|
29 | 1 | return; |
|
30 | } |
||
31 | } |
||
32 | |||
33 | return $this->getObjectManager()->getRepository($this->getEntityClass())->findOneBy([ |
||
34 | 'uuid' => $uuid->toString(), |
||
35 | 'namespace' => $namespace, |
||
36 | ]); |
||
37 | } |
||
38 | } |
||
39 |