Generalize VisitsDateRangeInput to VisitsListInput to add more common params

This commit is contained in:
Alejandro Celaya
2025-12-28 11:59:37 +01:00
parent a65c5c3b56
commit faed7ae60b
7 changed files with 22 additions and 20 deletions

View File

@@ -10,7 +10,7 @@ use Symfony\Component\Console\Attribute\Option;
use function Shlinkio\Shlink\Common\buildDateRange;
use function Shlinkio\Shlink\Core\normalizeOptionalDate;
class VisitsDateRangeInput
class VisitsListInput
{
#[Option('Only return visits older than this date', shortcut: 's')]
public string|null $startDate = null;
@@ -18,7 +18,7 @@ class VisitsDateRangeInput
#[Option('Only return visits newer than this date', shortcut: 'e')]
public string|null $endDate = null;
public function toDateRange(): DateRange
public function dateRange(): DateRange
{
return buildDateRange(
startDate: normalizeOptionalDate($this->startDate),