Replace interact method with Interact attribute in ReadEnvVarCommand

This commit is contained in:
Alejandro Celaya
2025-12-13 16:59:16 +01:00
parent 5a390894ea
commit 8fb8aea5f8

View File

@@ -8,10 +8,10 @@ use Closure;
use Shlinkio\Shlink\Core\Config\EnvVars;
use Symfony\Component\Console\Attribute\Argument;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Attribute\Interact;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use function Shlinkio\Shlink\Config\formatEnvVarValue;
@@ -37,9 +37,9 @@ class ReadEnvVarCommand extends Command
parent::__construct();
}
protected function interact(InputInterface $input, OutputInterface $output): void
#[Interact]
public function askMissing(InputInterface $input, SymfonyStyle $io): void
{
$io = new SymfonyStyle($input, $output);
$envVar = $input->getArgument('env-var');
$validEnvVars = enumValues(EnvVars::class);