mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-22 08:56:42 -06:00
Renamed method
This commit is contained in:
parent
e2abe23895
commit
1bcd03b150
@ -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()));
|
||||
|
@ -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([]);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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');
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user