Changed VisitLocator signature so that it expects an object implementing an interface instead of two arbitrary callbacks

This commit is contained in:
Alejandro Celaya
2020-03-28 08:05:15 +01:00
parent 43a3d469e7
commit fcce18b059
6 changed files with 110 additions and 69 deletions

View File

@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\Core\Visit;
use Shlinkio\Shlink\Core\Entity\Visit;
use Shlinkio\Shlink\Core\Entity\VisitLocation;
use Shlinkio\Shlink\Core\Exception\IpCannotBeLocatedException;
use Shlinkio\Shlink\IpGeolocation\Model\Location;
interface VisitGeolocationHelperInterface
{
/**
* @throws IpCannotBeLocatedException
*/
public function geolocateVisit(Visit $visit): Location;
public function onVisitLocated(VisitLocation $visitLocation, Visit $visit): void;
}