Updated to coding standard v2.1

This commit is contained in:
Alejandro Celaya
2020-01-01 20:48:31 +01:00
parent 1070482629
commit 50100c251e
112 changed files with 253 additions and 300 deletions

View File

@@ -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(''));