- Add
ArgvInput::getRawTokens()
- Add method
__toString()
toInputInterface
- Remove
Command::$defaultName
andCommand::$defaultDescription
, use theAsCommand
attribute instead - Require explicit argument when calling
*Command::setApplication()
,*FormatterStyle::setForeground/setBackground()
,Helper::setHelpSet()
,Input*::setDefault()
andQuestion::setAutocompleterCallback/setValidator()
- Remove
StringInput::REGEX_STRING
- Add
SignalMap
to map signal value to its name - Multi-line text in vertical tables is aligned properly
- The application can also catch errors with
Application::setCatchErrors(true)
- Add
RunCommandMessage
andRunCommandMessageHandler
- Dispatch
ConsoleTerminateEvent
after an exit on signal handling and addConsoleTerminateEvent::getInterruptingSignal()
- Add support for choosing exit code while handling signal, or to not exit at all
- Add
ProgressBar::setPlaceholderFormatter
to set a placeholder attached to a instance, instead of being global. - Add
ReStructuredTextDescriptor
- Improve truecolor terminal detection in some cases
- Add support for 256 color terminals (conversion from Ansi24 to Ansi8 if terminal is capable of it)
- Deprecate calling
*Command::setApplication()
,*FormatterStyle::setForeground/setBackground()
,Helper::setHelpSet()
,Input*::setDefault()
,Question::setAutocompleterCallback/setValidator()
without any arguments - Change the signature of
OutputFormatterStyleInterface::setForeground/setBackground()
tosetForeground/setBackground(?string)
- Change the signature of
HelperInterface::setHelperSet()
tosetHelperSet(?HelperSet)
- Add support to display table vertically when calling setVertical()
- Add method
__toString()
toInputInterface
- Added
OutputWrapper
to prevent truncated URL inSymfonyStyle::createBlock
. - Deprecate
Command::$defaultName
andCommand::$defaultDescription
, use theAsCommand
attribute instead - Add suggested values for arguments and options in input definition, for input completion
- Add
$resumeAt
parameter toProgressBar#start()
, so that one can easily 'resume' progress on longer tasks, and still get accurategetEstimate()
andgetRemaining()
results.
Command::setHidden()
has a default value (true
) for$hidden
parameter and is final- Remove
Helper::strlen()
, useHelper::width()
instead - Remove
Helper::strlenWithoutDecoration()
, useHelper::removeDecoration()
instead AddConsoleCommandPass
can not be configured anymore- Remove
HelperSet::setCommand()
andgetCommand()
without replacement
- Add
TesterTrait::assertCommandIsSuccessful()
to test command - Deprecate
HelperSet::setCommand()
andgetCommand()
without replacement
- Add
GithubActionReporter
to render annotations in a Github Action - Add
InputOption::VALUE_NEGATABLE
flag to handle--foo
/--no-foo
options - Add the
Command::$defaultDescription
static property and thedescription
attribute on theconsole.command
tag to allow thelist
command to instantiate commands lazily - Add option
--short
to thelist
command - Add support for bright colors
- Add
#[AsCommand]
attribute for declaring commands on PHP 8 - Add
Helper::width()
andHelper::length()
- The
--ansi
and--no-ansi
options now default tonull
.
- Added
SingleCommandApplication::setAutoExit()
to allow testing viaCommandTester
- added support for multiline responses to questions through
Question::setMultiline()
andQuestion::isMultiline()
- Added
SignalRegistry
class to stack signals handlers - Added support for signals:
- Added
Application::getSignalRegistry()
andApplication::setSignalsToDispatchEvent()
methods - Added
SignalableCommandInterface
interface
- Added
- Added
TableCellStyle
class to customize table cell - Removed
php
prefix invocation from help messages.
Command::setHidden()
is final since Symfony 5.1- Add
SingleCommandApplication
- Add
Cursor
class
- removed support for finding hidden commands using an abbreviation, use the full name instead
- removed
TableStyle::setCrossingChar()
method in favor ofTableStyle::setDefaultCrossingChar()
- removed
TableStyle::setHorizontalBorderChar()
method in favor ofTableStyle::setDefaultCrossingChars()
- removed
TableStyle::getHorizontalBorderChar()
method in favor ofTableStyle::getBorderChars()
- removed
TableStyle::setVerticalBorderChar()
method in favor ofTableStyle::setVerticalBorderChars()
- removed
TableStyle::getVerticalBorderChar()
method in favor ofTableStyle::getBorderChars()
- removed support for returning
null
fromCommand::execute()
, return0
instead ProcessHelper::run()
accepts onlyarray|Symfony\Component\Process\Process
for itscommand
argumentApplication::setDispatcher
accepts onlySymfony\Contracts\EventDispatcher\EventDispatcherInterface
for itsdispatcher
argument- renamed
Application::renderException()
andApplication::doRenderException()
torenderThrowable()
anddoRenderThrowable()
respectively.
- deprecated finding hidden commands using an abbreviation, use the full name instead
- added
Question::setTrimmable
default to true to allow the answer to be trimmed - added method
minSecondsBetweenRedraws()
andmaxSecondsBetweenRedraws()
onProgressBar
Application
implementsResetInterface
- marked all dispatched event classes as
@final
- added support for displaying table horizontally
- deprecated returning
null
fromCommand::execute()
, return0
instead - Deprecated the
Application::renderException()
andApplication::doRenderException()
methods, userenderThrowable()
anddoRenderThrowable()
instead. - added support for the
NO_COLOR
env var (https://no-color.org/)
- added support for hyperlinks
- added
ProgressBar::iterate()
method that simplify updating the progress bar when iterating - added
Question::setAutocompleterCallback()
to provide a callback function that dynamically generates suggestions as the user types
- allowed passing commands as
[$process, 'ENV_VAR' => 'value']
toProcessHelper::run()
to pass environment variables - deprecated passing a command as a string to
ProcessHelper::run()
, pass it the command as an array of its arguments instead - made the
ProcessHelper
class final - added
WrappableOutputFormatterInterface::formatAndWrap()
(implemented inOutputFormatter
) - added
capture_stderr_separately
option toCommandTester::execute()
- added option to run suggested command if command is not found and only 1 alternative is available
- added option to modify console output and print multiple modifiable sections
- added support for iterable messages in output
write
andwriteln
methods
OutputFormatter
throws an exception when unknown options are used- removed
QuestionHelper::setInputStream()/getInputStream()
- removed
Application::getTerminalWidth()/getTerminalHeight()
andApplication::setTerminalDimensions()/getTerminalDimensions()
- removed
ConsoleExceptionEvent
- removed
ConsoleEvents::EXCEPTION
- added
SHELL_VERBOSITY
env var to control verbosity - added
CommandLoaderInterface
,FactoryCommandLoader
and PSR-11ContainerCommandLoader
for commands lazy-loading - added a case-insensitive command name matching fallback
- added static
Command::$defaultName/getDefaultName()
, allowing for commands to be registered at compile time in the application command loader. Setting the$defaultName
property avoids the need for filling thecommand
attribute on theconsole.command
tag when usingAddConsoleCommandPass
.
- added
ExceptionListener
- added
AddConsoleCommandPass
(originally in FrameworkBundle) - [BC BREAK]
Input::getOption()
no longer returns the default value for options with value optional explicitly passed empty - added console.error event to catch exceptions thrown by other listeners
- deprecated console.exception event in favor of console.error
- added ability to handle
CommandNotFoundException
through theconsole.error
event - deprecated default validation in
SymfonyQuestionHelper::ask
- added
setInputs()
method to CommandTester for ease testing of commands expecting inputs - added
setStream()
andgetStream()
methods to Input (implement StreamableInputInterface) - added StreamableInputInterface
- added LockableTrait
- added truncate method to FormatterHelper
- added setColumnWidth(s) method to Table
- remove readline support from the question helper as it caused issues
- use readline for user input in the question helper when available to allow the use of arrow keys
- added a Process helper
- added a DebugFormatter helper
- deprecated the dialog helper (use the question helper instead)
- deprecated TableHelper in favor of Table
- deprecated ProgressHelper in favor of ProgressBar
- added ConsoleLogger
- added a question helper
- added a way to set the process name of a command
- added a way to set a default command instead of
ListCommand
- added a way to force terminal dimensions
- added a convenient method to detect verbosity level
- [BC BREAK] made descriptors use output instead of returning a string
- added multiselect support to the select dialog helper
- added Table Helper for tabular data rendering
- added support for events in
Application
- added a way to normalize EOLs in
ApplicationTester::getDisplay()
andCommandTester::getDisplay()
- added a way to set the progress bar progress via the
setCurrent
method - added support for multiple InputOption shortcuts, written as
'-a|-b|-c'
- added two additional verbosity levels, VERBOSITY_VERY_VERBOSE and VERBOSITY_DEBUG
- added support for colorization on Windows via ConEmu
- add a method to Dialog Helper to ask for a question and hide the response
- added support for interactive selections in console (DialogHelper::select())
- added support for autocompletion as you type in Dialog Helper
- added ConsoleOutputInterface
- added the possibility to disable a command (Command::isEnabled())
- added suggestions when a command does not exist
- added a --raw option to the list command
- added support for STDERR in the console output class (errors are now sent to STDERR)
- made the defaults (helper set, commands, input definition) in Application more easily customizable
- added support for the shell even if readline is not available
- added support for process isolation in Symfony shell via
--process-isolation
switch - added support for
--
, which disables options parsing after that point (tokens will be parsed as arguments)