Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | 6 | public function resolveDomain(?string $domain): ?Domain |
|
20 | { |
||
21 | 6 | if ($domain === null) { |
|
22 | 4 | return null; |
|
23 | } |
||
24 | |||
25 | /** @var Domain|null $existingDomain */ |
||
26 | 2 | $existingDomain = $this->em->getRepository(Domain::class)->findOneBy(['authority' => $domain]); |
|
27 | 2 | return $existingDomain ?? new Domain($domain); |
|
28 | } |
||
30 |