getArgument($argument)) { return; } $value = $io->ask($question, null, static function (?string $v) use ($errorMessage): string { if (null === $v || '' === trim($v)) { throw new \RuntimeException($errorMessage); } return ucfirst(trim($v)); }); $input->setArgument($argument, $value); } }