Symfony 8.1 introduces several improvements to console command input handling. New features include: pasting images directly into terminal prompts via the InputFile type and #[Ask] attribute (with graceful fallback to file paths); the #[AskChoice] attribute for interactive single or multiple-choice selections with BackedEnum support; boolean defaults for negatable options; objects as default values for arguments and options; the RawInputInterface with getRawArguments(), getRawOptions(), and unparse() methods for forwarding input to child processes; and Symfony Validator constraint integration for both interactive answers and #[MapInput]-mapped objects.

5m read timeFrom symfony.com
Post cover image
Table of contents
Pasting Images As AnswersInteractive Choice QuestionsBoolean Defaults for Negatable OptionsObjects As Default Values for Options And ArgumentsAccessing And Forwarding the Original InputValidating Interactive AnswersValidating Mapped Input Objects

Sort: