mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Replaced regular callbacks by arrow functions when possible
This commit is contained in:
@@ -44,7 +44,7 @@ class UrlShortenerTest extends TestCase
|
||||
$this->em->beginTransaction()->willReturn(null);
|
||||
$this->em->persist(Argument::any())->will(function ($arguments) {
|
||||
/** @var ShortUrl $shortUrl */
|
||||
$shortUrl = $arguments[0];
|
||||
[$shortUrl] = $arguments;
|
||||
$shortUrl->setId('10');
|
||||
});
|
||||
$repo = $this->prophesize(ShortUrlRepository::class);
|
||||
@@ -240,9 +240,7 @@ class UrlShortenerTest extends TestCase
|
||||
'validUntil' => Chronos::parse('2017-01-01'),
|
||||
'maxVisits' => 4,
|
||||
]);
|
||||
$tagsCollection = new ArrayCollection(array_map(function (string $tag) {
|
||||
return new Tag($tag);
|
||||
}, $tags));
|
||||
$tagsCollection = new ArrayCollection(array_map(fn (string $tag) => new Tag($tag), $tags));
|
||||
$expected = (new ShortUrl($url, $meta))->setTags($tagsCollection);
|
||||
|
||||
$repo = $this->prophesize(ShortUrlRepository::class);
|
||||
|
||||
Reference in New Issue
Block a user