Replaced regular callbacks by arrow functions when possible

This commit is contained in:
Alejandro Celaya
2019-12-29 23:16:55 +01:00
parent a830420d75
commit bfeb915cd2
19 changed files with 42 additions and 75 deletions

View File

@@ -43,10 +43,7 @@ class VisitsTrackerTest extends TestCase
$repo->findOneBy(['shortCode' => $shortCode])->willReturn(new ShortUrl(''));
$this->em->getRepository(ShortUrl::class)->willReturn($repo->reveal())->shouldBeCalledOnce();
$this->em->persist(Argument::that(function (Visit $visit) {
$visit->setId('1');
return $visit;
}))->shouldBeCalledOnce();
$this->em->persist(Argument::that(fn (Visit $visit) => $visit->setId('1')))->shouldBeCalledOnce();
$this->em->flush()->shouldBeCalledOnce();
$this->visitsTracker->track($shortCode, Visitor::emptyInstance());