2016-04-17 13:42:52 +02:00
|
|
|
<?php
|
2017-10-12 10:13:20 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2016-07-19 18:01:39 +02:00
|
|
|
namespace Shlinkio\Shlink\Core\Service;
|
2016-04-17 13:42:52 +02:00
|
|
|
|
2016-07-19 18:01:39 +02:00
|
|
|
use Shlinkio\Shlink\Core\Entity\Visit;
|
2017-12-30 21:35:26 +01:00
|
|
|
use Shlinkio\Shlink\Core\Exception\InvalidArgumentException;
|
2018-10-18 20:19:22 +02:00
|
|
|
use Shlinkio\Shlink\Core\Model\Visitor;
|
2018-11-27 21:09:27 +01:00
|
|
|
use Shlinkio\Shlink\Core\Model\VisitsParams;
|
2016-06-12 21:51:06 +02:00
|
|
|
|
2016-04-17 13:42:52 +02:00
|
|
|
interface VisitsTrackerInterface
|
|
|
|
|
{
|
|
|
|
|
/**
|
2018-10-18 20:19:22 +02:00
|
|
|
* Tracks a new visit to provided short code from provided visitor
|
2016-04-17 13:42:52 +02:00
|
|
|
*/
|
2018-10-18 20:19:22 +02:00
|
|
|
public function track(string $shortCode, Visitor $visitor): void;
|
2016-06-12 21:51:06 +02:00
|
|
|
|
|
|
|
|
/**
|
2016-07-21 09:36:38 +02:00
|
|
|
* Returns the visits on certain short code
|
2016-06-12 21:51:06 +02:00
|
|
|
*
|
2016-07-21 09:36:38 +02:00
|
|
|
* @return Visit[]
|
2017-10-22 09:00:32 +02:00
|
|
|
* @throws InvalidArgumentException
|
2016-06-12 21:51:06 +02:00
|
|
|
*/
|
2018-11-27 21:09:27 +01:00
|
|
|
public function info(string $shortCode, VisitsParams $params): array;
|
2016-04-17 13:42:52 +02:00
|
|
|
}
|