mirror of
https://github.com/shlinkio/shlink.git
synced 2026-02-28 04:03:12 +08:00
Replaced regular callbacks by arrow functions when possible
This commit is contained in:
@@ -46,8 +46,6 @@ class ListTagsCommand extends Command
|
||||
return [['No tags yet']];
|
||||
}
|
||||
|
||||
return map($tags, function (Tag $tag) {
|
||||
return [(string) $tag];
|
||||
});
|
||||
return map($tags, fn (Tag $tag) => [(string) $tag]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,9 +42,9 @@ class ListShortUrlsCommandTest extends TestCase
|
||||
$data[] = new ShortUrl('url_' . $i);
|
||||
}
|
||||
|
||||
$this->shortUrlService->listShortUrls(Argument::cetera())->will(function () use (&$data) {
|
||||
return new Paginator(new ArrayAdapter($data));
|
||||
})->shouldBeCalledTimes(3);
|
||||
$this->shortUrlService->listShortUrls(Argument::cetera())
|
||||
->will(fn () => new Paginator(new ArrayAdapter($data)))
|
||||
->shouldBeCalledTimes(3);
|
||||
|
||||
$this->commandTester->setInputs(['y', 'y', 'n']);
|
||||
$this->commandTester->execute([]);
|
||||
|
||||
@@ -50,9 +50,7 @@ class GeolocationDbUpdaterTest extends TestCase
|
||||
/** @test */
|
||||
public function exceptionIsThrownWhenOlderDbDoesNotExistAndDownloadFails(): void
|
||||
{
|
||||
$mustBeUpdated = function () {
|
||||
$this->assertTrue(true);
|
||||
};
|
||||
$mustBeUpdated = fn () => $this->assertTrue(true);
|
||||
$prev = new RuntimeException('');
|
||||
|
||||
$fileExists = $this->dbUpdater->databaseFileExists()->willReturn(false);
|
||||
@@ -148,8 +146,6 @@ class GeolocationDbUpdaterTest extends TestCase
|
||||
|
||||
public function provideSmallDays(): iterable
|
||||
{
|
||||
return map(range(0, 34), function (int $days) {
|
||||
return [$days];
|
||||
});
|
||||
return map(range(0, 34), fn (int $days) => [$days]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user