mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 01:33:11 +08:00
Updated to coding standard v2.1
This commit is contained in:
@@ -42,21 +42,21 @@ class VisitServiceTest extends TestCase
|
||||
{
|
||||
$unlocatedVisits = map(
|
||||
range(1, 200),
|
||||
fn (int $i) => new Visit(new ShortUrl(sprintf('short_code_%s', $i)), Visitor::emptyInstance())
|
||||
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);
|
||||
$getRepo = $this->em->getRepository(Visit::class)->willReturn($repo->reveal());
|
||||
|
||||
$persist = $this->em->persist(Argument::type(Visit::class))->will(function () {
|
||||
$persist = $this->em->persist(Argument::type(Visit::class))->will(function (): void {
|
||||
});
|
||||
$flush = $this->em->flush()->will(function () {
|
||||
$flush = $this->em->flush()->will(function (): void {
|
||||
});
|
||||
$clear = $this->em->clear()->will(function () {
|
||||
$clear = $this->em->clear()->will(function (): void {
|
||||
});
|
||||
|
||||
$this->visitService->locateUnlocatedVisits(fn () => Location::emptyInstance(), function () {
|
||||
$this->visitService->locateUnlocatedVisits(fn () => Location::emptyInstance(), function (): void {
|
||||
$args = func_get_args();
|
||||
|
||||
$this->assertInstanceOf(VisitLocation::class, array_shift($args));
|
||||
@@ -84,14 +84,14 @@ class VisitServiceTest extends TestCase
|
||||
$findUnlocatedVisits = $repo->findUnlocatedVisits(false)->willReturn($unlocatedVisits);
|
||||
$getRepo = $this->em->getRepository(Visit::class)->willReturn($repo->reveal());
|
||||
|
||||
$persist = $this->em->persist(Argument::type(Visit::class))->will(function () {
|
||||
$persist = $this->em->persist(Argument::type(Visit::class))->will(function (): void {
|
||||
});
|
||||
$flush = $this->em->flush()->will(function () {
|
||||
$flush = $this->em->flush()->will(function (): void {
|
||||
});
|
||||
$clear = $this->em->clear()->will(function () {
|
||||
$clear = $this->em->clear()->will(function (): void {
|
||||
});
|
||||
|
||||
$this->visitService->locateUnlocatedVisits(function () use ($isNonLocatableAddress) {
|
||||
$this->visitService->locateUnlocatedVisits(function () use ($isNonLocatableAddress): void {
|
||||
throw $isNonLocatableAddress
|
||||
? new IpCannotBeLocatedException('Cannot be located')
|
||||
: IpCannotBeLocatedException::forError(new Exception(''));
|
||||
|
||||
Reference in New Issue
Block a user