mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 15:23:12 +08:00
Replaced regular callbacks by arrow functions when possible
This commit is contained in:
@@ -40,9 +40,10 @@ class VisitServiceTest extends TestCase
|
||||
/** @test */
|
||||
public function locateVisitsIteratesAndLocatesUnlocatedVisits(): void
|
||||
{
|
||||
$unlocatedVisits = map(range(1, 200), function (int $i) {
|
||||
return new Visit(new ShortUrl(sprintf('short_code_%s', $i)), Visitor::emptyInstance());
|
||||
});
|
||||
$unlocatedVisits = map(
|
||||
range(1, 200),
|
||||
fn (int $i) => new Visit(new ShortUrl(sprintf('short_code_%s', $i)), Visitor::emptyInstance())
|
||||
);
|
||||
|
||||
$repo = $this->prophesize(VisitRepository::class);
|
||||
$findUnlocatedVisits = $repo->findUnlocatedVisits(false)->willReturn($unlocatedVisits);
|
||||
@@ -55,9 +56,7 @@ class VisitServiceTest extends TestCase
|
||||
$clear = $this->em->clear()->will(function () {
|
||||
});
|
||||
|
||||
$this->visitService->locateUnlocatedVisits(function () {
|
||||
return Location::emptyInstance();
|
||||
}, function () {
|
||||
$this->visitService->locateUnlocatedVisits(fn () => Location::emptyInstance(), function () {
|
||||
$args = func_get_args();
|
||||
|
||||
$this->assertInstanceOf(VisitLocation::class, array_shift($args));
|
||||
|
||||
Reference in New Issue
Block a user