Renamed method

This commit is contained in:
Alejandro Celaya 2019-02-17 13:21:07 +01:00
parent e2abe23895
commit 1bcd03b150
5 changed files with 9 additions and 9 deletions

View File

@ -62,7 +62,7 @@ class ProcessVisitsCommand extends Command
}
try {
$this->visitService->locateVisits(
$this->visitService->locateUnlocatedVisits(
[$this, 'getGeolocationDataForVisit'],
function (VisitLocation $location) use ($output) {
$output->writeln(sprintf(' [<info>Address located at "%s"</info>]', $location->getCountryName()));

View File

@ -65,7 +65,7 @@ class ProcessVisitsCommandTest extends TestCase
$visit = new Visit(new ShortUrl(''), new Visitor('', '', '1.2.3.4'));
$location = new VisitLocation(Location::emptyInstance());
$locateVisits = $this->visitService->locateVisits(Argument::cetera())->will(
$locateVisits = $this->visitService->locateUnlocatedVisits(Argument::cetera())->will(
function (array $args) use ($visit, $location) {
$firstCallback = array_shift($args);
$firstCallback($visit);
@ -97,7 +97,7 @@ class ProcessVisitsCommandTest extends TestCase
$visit = new Visit(new ShortUrl(''), new Visitor('', '', $address));
$location = new VisitLocation(Location::emptyInstance());
$locateVisits = $this->visitService->locateVisits(Argument::cetera())->will(
$locateVisits = $this->visitService->locateUnlocatedVisits(Argument::cetera())->will(
function (array $args) use ($visit, $location) {
$firstCallback = array_shift($args);
$firstCallback($visit);
@ -133,7 +133,7 @@ class ProcessVisitsCommandTest extends TestCase
$visit = new Visit(new ShortUrl(''), new Visitor('', '', '1.2.3.4'));
$location = new VisitLocation(Location::emptyInstance());
$locateVisits = $this->visitService->locateVisits(Argument::cetera())->will(
$locateVisits = $this->visitService->locateUnlocatedVisits(Argument::cetera())->will(
function (array $args) use ($visit, $location) {
$firstCallback = array_shift($args);
$firstCallback($visit);
@ -162,7 +162,7 @@ class ProcessVisitsCommandTest extends TestCase
{
$this->lock->acquire()->willReturn(false);
$locateVisits = $this->visitService->locateVisits(Argument::cetera())->will(function () {
$locateVisits = $this->visitService->locateUnlocatedVisits(Argument::cetera())->will(function () {
});
$resolveIpLocation = $this->ipResolver->resolveIpLocation(Argument::any())->willReturn([]);

View File

@ -20,7 +20,7 @@ class VisitService implements VisitServiceInterface
$this->em = $em;
}
public function locateVisits(callable $geolocateVisit, ?callable $notifyVisitWithLocation = null): void
public function locateUnlocatedVisits(callable $geolocateVisit, ?callable $notifyVisitWithLocation = null): void
{
/** @var VisitRepository $repo */
$repo = $this->em->getRepository(Visit::class);

View File

@ -5,5 +5,5 @@ namespace Shlinkio\Shlink\Core\Service;
interface VisitServiceInterface
{
public function locateVisits(callable $geolocateVisit, ?callable $notifyVisitWithLocation = null): void;
public function locateUnlocatedVisits(callable $geolocateVisit, ?callable $notifyVisitWithLocation = null): void;
}

View File

@ -51,7 +51,7 @@ class VisitServiceTest extends TestCase
$clear = $this->em->clear()->will(function () {
});
$this->visitService->locateVisits(function () {
$this->visitService->locateUnlocatedVisits(function () {
return Location::emptyInstance();
}, function () {
$args = func_get_args();
@ -87,7 +87,7 @@ class VisitServiceTest extends TestCase
$clear = $this->em->clear()->will(function () {
});
$this->visitService->locateVisits(function () {
$this->visitService->locateUnlocatedVisits(function () {
throw new IpCannotBeLocatedException('Cannot be located');
});