Added nullsafe operator to simplify conditions

This commit is contained in:
Alejandro Celaya
2021-05-23 12:31:10 +02:00
parent e0f0bb5523
commit c01121d61a
64 changed files with 95 additions and 113 deletions

View File

@@ -126,7 +126,7 @@ class DomainServiceTest extends TestCase
$repo = $this->prophesize(DomainRepositoryInterface::class);
$repo->findOneBy(['authority' => $authority])->willReturn($foundDomain);
$getRepo = $this->em->getRepository(Domain::class)->willReturn($repo->reveal());
$persist = $this->em->persist($foundDomain !== null ? $foundDomain : Argument::type(Domain::class));
$persist = $this->em->persist($foundDomain ?? Argument::type(Domain::class));
$flush = $this->em->flush();
$result = $this->domainService->getOrCreate($authority);