mirror of
https://github.com/shlinkio/shlink.git
synced 2025-12-12 00:36:16 -06:00
31 lines
790 B
PHP
31 lines
790 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Shlinkio\Shlink\CLI\Input;
|
|
|
|
use Cake\Chronos\Chronos;
|
|
use Symfony\Component\Console\Command\Command;
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
use Symfony\Component\Console\Output\OutputInterface;
|
|
|
|
use function sprintf;
|
|
|
|
class StartDateOption
|
|
{
|
|
private readonly DateOption $dateOption;
|
|
|
|
public function __construct(Command $command, string $descriptionHint)
|
|
{
|
|
$this->dateOption = new DateOption($command, 'start-date', 's', sprintf(
|
|
'Allows to filter %s, returning only those older than provided date.',
|
|
$descriptionHint,
|
|
));
|
|
}
|
|
|
|
public function get(InputInterface $input, OutputInterface $output): ?Chronos
|
|
{
|
|
return $this->dateOption->get($input, $output);
|
|
}
|
|
}
|