diff --git a/CHANGELOG.md b/CHANGELOG.md index c5a69637e..3b8525624 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -83,9 +83,9 @@ CHANGELOG * `OutputFormatter` throws an exception when unknown options are used * removed `QuestionHelper::setInputStream()/getInputStream()` * removed `Application::getTerminalWidth()/getTerminalHeight()` and - `Application::setTerminalDimensions()/getTerminalDimensions()` -* removed `ConsoleExceptionEvent` -* removed `ConsoleEvents::EXCEPTION` + `Application::setTerminalDimensions()/getTerminalDimensions()` + * removed `ConsoleExceptionEvent` + * removed `ConsoleEvents::EXCEPTION` 3.4.0 ----- @@ -102,23 +102,23 @@ CHANGELOG 3.3.0 ----- -* 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 the - `console.error` event -* deprecated default validation in `SymfonyQuestionHelper::ask` + * 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 the + `console.error` event + * deprecated default validation in `SymfonyQuestionHelper::ask` 3.2.0 ------ -* added `setInputs()` method to CommandTester for ease testing of commands expecting inputs -* added `setStream()` and `getStream()` methods to Input (implement StreamableInputInterface) -* added StreamableInputInterface -* added LockableTrait + * added `setInputs()` method to CommandTester for ease testing of commands expecting inputs + * added `setStream()` and `getStream()` methods to Input (implement StreamableInputInterface) + * added StreamableInputInterface + * added LockableTrait 3.1.0 ----- diff --git a/ConsoleEvents.php b/ConsoleEvents.php index d63beed94..be6f435d3 100644 --- a/ConsoleEvents.php +++ b/ConsoleEvents.php @@ -30,7 +30,7 @@ final class ConsoleEvents * * @Event("Symfony\Component\Console\Event\ConsoleCommandEvent") */ - const COMMAND = 'console.command'; + public const COMMAND = 'console.command'; /** * The SIGNAL event allows you to perform some actions @@ -38,7 +38,7 @@ final class ConsoleEvents * * @Event("Symfony\Component\Console\Event\ConsoleSignalEvent") */ - const SIGNAL = 'console.signal'; + public const SIGNAL = 'console.signal'; /** * The TERMINATE event allows you to attach listeners after a command is @@ -46,7 +46,7 @@ final class ConsoleEvents * * @Event("Symfony\Component\Console\Event\ConsoleTerminateEvent") */ - const TERMINATE = 'console.terminate'; + public const TERMINATE = 'console.terminate'; /** * The ERROR event occurs when an uncaught exception or error appears. @@ -56,14 +56,14 @@ final class ConsoleEvents * * @Event("Symfony\Component\Console\Event\ConsoleErrorEvent") */ - const ERROR = 'console.error'; + public const ERROR = 'console.error'; /** * Event aliases. * * These aliases can be consumed by RegisterListenersPass. */ - const ALIASES = [ + public const ALIASES = [ ConsoleCommandEvent::class => self::COMMAND, ConsoleErrorEvent::class => self::ERROR, ConsoleSignalEvent::class => self::SIGNAL, diff --git a/DependencyInjection/AddConsoleCommandPass.php b/DependencyInjection/AddConsoleCommandPass.php index f4cd3874c..77ae6f9d4 100644 --- a/DependencyInjection/AddConsoleCommandPass.php +++ b/DependencyInjection/AddConsoleCommandPass.php @@ -29,12 +29,14 @@ class AddConsoleCommandPass implements CompilerPassInterface private $commandLoaderServiceId; private $commandTag; private $noPreloadTag; + private $privateTagName; - public function __construct(string $commandLoaderServiceId = 'console.command_loader', string $commandTag = 'console.command', string $noPreloadTag = 'container.no_preload') + public function __construct(string $commandLoaderServiceId = 'console.command_loader', string $commandTag = 'console.command', string $noPreloadTag = 'container.no_preload', string $privateTagName = 'container.private') { $this->commandLoaderServiceId = $commandLoaderServiceId; $this->commandTag = $commandTag; $this->noPreloadTag = $noPreloadTag; + $this->privateTagName = $privateTagName; } public function process(ContainerBuilder $container) @@ -62,7 +64,7 @@ public function process(ContainerBuilder $container) } if (null === $commandName) { - if (!$definition->isPublic() || $definition->isPrivate()) { + if (!$definition->isPublic() || $definition->isPrivate() || $definition->hasTag($this->privateTagName)) { $commandId = 'console.command.public_alias.'.$id; $container->setAlias($commandId, $id)->setPublic(true); $id = $commandId; diff --git a/Descriptor/ApplicationDescription.php b/Descriptor/ApplicationDescription.php index d361b4890..3192c0f6f 100644 --- a/Descriptor/ApplicationDescription.php +++ b/Descriptor/ApplicationDescription.php @@ -22,7 +22,7 @@ */ class ApplicationDescription { - const GLOBAL_NAMESPACE = '_global'; + public const GLOBAL_NAMESPACE = '_global'; private $application; private $namespace; diff --git a/Event/ConsoleCommandEvent.php b/Event/ConsoleCommandEvent.php index a24697cdc..08bd18fd1 100644 --- a/Event/ConsoleCommandEvent.php +++ b/Event/ConsoleCommandEvent.php @@ -21,7 +21,7 @@ final class ConsoleCommandEvent extends ConsoleEvent /** * The return code for skipped commands, this will also be passed into the terminate event. */ - const RETURN_CODE_DISABLED = 113; + public const RETURN_CODE_DISABLED = 113; /** * Indicates if the command should be run or skipped. diff --git a/Formatter/OutputFormatterStyle.php b/Formatter/OutputFormatterStyle.php index b2d9fbefb..0fb36ac63 100644 --- a/Formatter/OutputFormatterStyle.php +++ b/Formatter/OutputFormatterStyle.php @@ -95,7 +95,8 @@ public function setOptions(array $options) public function apply(string $text) { if (null === $this->handlesHrefGracefully) { - $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') && !getenv('KONSOLE_VERSION'); + $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') + && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); } if (null !== $this->href && $this->handlesHrefGracefully) { diff --git a/Helper/TableCellStyle.php b/Helper/TableCellStyle.php index 4766ba373..ad9aea83b 100644 --- a/Helper/TableCellStyle.php +++ b/Helper/TableCellStyle.php @@ -18,7 +18,7 @@ */ class TableCellStyle { - const DEFAULT_ALIGN = 'left'; + public const DEFAULT_ALIGN = 'left'; private $options = [ 'fg' => 'default', diff --git a/Input/InputArgument.php b/Input/InputArgument.php index b6aa6452a..140c86d0e 100644 --- a/Input/InputArgument.php +++ b/Input/InputArgument.php @@ -21,9 +21,9 @@ */ class InputArgument { - const REQUIRED = 1; - const OPTIONAL = 2; - const IS_ARRAY = 4; + public const REQUIRED = 1; + public const OPTIONAL = 2; + public const IS_ARRAY = 4; private $name; private $mode; diff --git a/Input/InputOption.php b/Input/InputOption.php index d62e0aea0..66f857a6c 100644 --- a/Input/InputOption.php +++ b/Input/InputOption.php @@ -21,10 +21,10 @@ */ class InputOption { - const VALUE_NONE = 1; - const VALUE_REQUIRED = 2; - const VALUE_OPTIONAL = 4; - const VALUE_IS_ARRAY = 8; + public const VALUE_NONE = 1; + public const VALUE_REQUIRED = 2; + public const VALUE_OPTIONAL = 4; + public const VALUE_IS_ARRAY = 8; private $name; private $shortcut; diff --git a/Input/StringInput.php b/Input/StringInput.php index 6fddf6488..2890b0f5f 100644 --- a/Input/StringInput.php +++ b/Input/StringInput.php @@ -24,8 +24,8 @@ */ class StringInput extends ArgvInput { - const REGEX_STRING = '([^\s]+?)(?:\s|(?getOutputStream(), 0, 0); @@ -887,7 +887,7 @@ public function testIterate(): void ); } - public function testIterateUncountable(): void + public function testIterateUncountable() { $bar = new ProgressBar($output = $this->getOutputStream(), 0, 0); @@ -936,7 +936,7 @@ public function testBarWidthWithMultilineFormat() putenv('COLUMNS=120'); } - public function testMinAndMaxSecondsBetweenRedraws(): void + public function testMinAndMaxSecondsBetweenRedraws() { $bar = new ProgressBar($output = $this->getOutputStream()); $bar->setRedrawFrequency(1); @@ -959,7 +959,7 @@ public function testMinAndMaxSecondsBetweenRedraws(): void ); } - public function testMaxSecondsBetweenRedraws(): void + public function testMaxSecondsBetweenRedraws() { $bar = new ProgressBar($output = $this->getOutputStream(), 0, 0); $bar->setRedrawFrequency(4); // disable step based redraws @@ -1014,7 +1014,7 @@ public function testMinSecondsBetweenRedraws() ); } - public function testNoWriteWhenMessageIsSame(): void + public function testNoWriteWhenMessageIsSame() { $bar = new ProgressBar($output = $this->getOutputStream(), 2); $bar->start(); diff --git a/Tests/Helper/TableTest.php b/Tests/Helper/TableTest.php index 24d075bad..0337053e9 100644 --- a/Tests/Helper/TableTest.php +++ b/Tests/Helper/TableTest.php @@ -1470,7 +1470,7 @@ protected function getOutputContent(StreamOutput $output) return str_replace(\PHP_EOL, "\n", stream_get_contents($output->getStream())); } - public function testWithColspanAndMaxWith(): void + public function testWithColspanAndMaxWith() { $table = new Table($output = $this->getOutputStream());