mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-07 07:43:12 +08:00
31 lines
851 B
PHP
31 lines
851 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Shlinkio\Shlink\Core\Service;
|
|
|
|
use Psr\Http\Message\ServerRequestInterface;
|
|
use Shlinkio\Shlink\Common\Util\DateRange;
|
|
use Shlinkio\Shlink\Core\Entity\Visit;
|
|
use Shlinkio\Shlink\Core\Exception\InvalidArgumentException;
|
|
|
|
interface VisitsTrackerInterface
|
|
{
|
|
/**
|
|
* Tracks a new visit to provided short code, using an array of data to look up information
|
|
*
|
|
* @param string $shortCode
|
|
* @param ServerRequestInterface $request
|
|
*/
|
|
public function track($shortCode, ServerRequestInterface $request);
|
|
|
|
/**
|
|
* Returns the visits on certain short code
|
|
*
|
|
* @param string $shortCode
|
|
* @param DateRange $dateRange
|
|
* @return Visit[]
|
|
* @throws InvalidArgumentException
|
|
*/
|
|
public function info(string $shortCode, DateRange $dateRange = null): array;
|
|
}
|