Replaced deprecated transactional function with wrapTransaction

This commit is contained in:
Alejandro Celaya 2022-02-27 08:10:18 +01:00
parent 9e32886f60
commit 1b6512fc8d
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ class UrlShortener implements UrlShortenerInterface
/** @var ShortUrlMeta $meta */ /** @var ShortUrlMeta $meta */
$meta = $this->titleResolutionHelper->processTitleAndValidateUrl($meta); $meta = $this->titleResolutionHelper->processTitleAndValidateUrl($meta);
return $this->em->transactional(function () use ($meta) { return $this->em->wrapInTransaction(function () use ($meta) {
$shortUrl = ShortUrl::fromMeta($meta, $this->relationResolver); $shortUrl = ShortUrl::fromMeta($meta, $this->relationResolver);
$this->verifyShortCodeUniqueness($meta, $shortUrl); $this->verifyShortCodeUniqueness($meta, $shortUrl);

View File

@ -39,7 +39,7 @@ class UrlShortenerTest extends TestCase
[$shortUrl] = $arguments; [$shortUrl] = $arguments;
$shortUrl->setId('10'); $shortUrl->setId('10');
}); });
$this->em->transactional(Argument::type('callable'))->will(function (array $args) { $this->em->wrapInTransaction(Argument::type('callable'))->will(function (array $args) {
/** @var callable $callback */ /** @var callable $callback */
[$callback] = $args; [$callback] = $args;