diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index fac90216ca..21275e6790 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -43,8 +43,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\Debug\ErrorHandler; use Symfony\Component\Debug\Exception\FatalThrowableError; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy; +use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; /** * An Application is the container for a collection of commands. @@ -92,11 +91,11 @@ class Application } /** - * @final since Symfony 4.3, the type-hint will be updated to the interface from symfony/contracts in 5.0 + * @final */ public function setDispatcher(EventDispatcherInterface $dispatcher) { - $this->dispatcher = LegacyEventDispatcherProxy::decorate($dispatcher); + $this->dispatcher = $dispatcher; } public function setCommandLoader(CommandLoaderInterface $commandLoader) diff --git a/src/Symfony/Component/Console/CHANGELOG.md b/src/Symfony/Component/Console/CHANGELOG.md index 67decd30be..46b71d345d 100644 --- a/src/Symfony/Component/Console/CHANGELOG.md +++ b/src/Symfony/Component/Console/CHANGELOG.md @@ -1,6 +1,18 @@ CHANGELOG ========= +5.0.0 +----- + + * removed `TableStyle::setCrossingChar()` method in favor of `TableStyle::setDefaultCrossingChar()` + * removed `TableStyle::setHorizontalBorderChar()` method in favor of `TableStyle::setDefaultCrossingChars()` + * removed `TableStyle::getHorizontalBorderChar()` method in favor of `TableStyle::getBorderChars()` + * removed `TableStyle::setVerticalBorderChar()` method in favor of `TableStyle::setVerticalBorderChars()` + * removed `TableStyle::getVerticalBorderChar()` method in favor of `TableStyle::getBorderChars()` + * `ProcessHelper::run()` accepts only `array|Symfony\Component\Process\Process` for its `command` argument + * `Application::setDispatcher` accepts only `Symfony\Contracts\EventDispatcher\EventDispatcherInterface` + for its `dispatcher` argument + 4.3.0 ----- diff --git a/src/Symfony/Component/Console/Event/ConsoleEvent.php b/src/Symfony/Component/Console/Event/ConsoleEvent.php index 5440da216c..89ab645594 100644 --- a/src/Symfony/Component/Console/Event/ConsoleEvent.php +++ b/src/Symfony/Component/Console/Event/ConsoleEvent.php @@ -14,7 +14,7 @@ namespace Symfony\Component\Console\Event; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\EventDispatcher\Event; +use Symfony\Contracts\EventDispatcher\Event; /** * Allows to inspect input and output of a command. diff --git a/src/Symfony/Component/Console/Helper/ProcessHelper.php b/src/Symfony/Component/Console/Helper/ProcessHelper.php index e3a7c77b35..55a3354bcf 100644 --- a/src/Symfony/Component/Console/Helper/ProcessHelper.php +++ b/src/Symfony/Component/Console/Helper/ProcessHelper.php @@ -21,7 +21,7 @@ use Symfony\Component\Process\Process; * * @author Fabien Potencier * - * @final since Symfony 4.2 + * @final */ class ProcessHelper extends Helper { @@ -50,8 +50,7 @@ class ProcessHelper extends Helper } if (!\is_array($cmd)) { - @trigger_error(sprintf('Passing a command as a string to "%s()" is deprecated since Symfony 4.2, pass it the command as an array of arguments instead.', __METHOD__), E_USER_DEPRECATED); - $cmd = [\method_exists(Process::class, 'fromShellCommandline') ? Process::fromShellCommandline($cmd) : new Process($cmd)]; + throw new \TypeError(sprintf('The "command" argument of "%s()" must be an array or a "%s" instance, "%s" given.', __METHOD__, Process::class, \is_object($cmd) ? \get_class($cmd) : \gettype($cmd))); } if (\is_string($cmd[0] ?? null)) { diff --git a/src/Symfony/Component/Console/Helper/TableStyle.php b/src/Symfony/Component/Console/Helper/TableStyle.php index 02dd693c8f..020bce96de 100644 --- a/src/Symfony/Component/Console/Helper/TableStyle.php +++ b/src/Symfony/Component/Console/Helper/TableStyle.php @@ -101,36 +101,6 @@ class TableStyle return $this; } - /** - * Sets horizontal border character. - * - * @param string $horizontalBorderChar - * - * @return $this - * - * @deprecated since Symfony 4.1, use {@link setHorizontalBorderChars()} instead. - */ - public function setHorizontalBorderChar($horizontalBorderChar) - { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use setHorizontalBorderChars() instead.', __METHOD__), E_USER_DEPRECATED); - - return $this->setHorizontalBorderChars($horizontalBorderChar, $horizontalBorderChar); - } - - /** - * Gets horizontal border character. - * - * @return string - * - * @deprecated since Symfony 4.1, use {@link getBorderChars()} instead. - */ - public function getHorizontalBorderChar() - { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), E_USER_DEPRECATED); - - return $this->horizontalOutsideBorderChar; - } - /** * Sets vertical border characters. * @@ -157,36 +127,6 @@ class TableStyle return $this; } - /** - * Sets vertical border character. - * - * @param string $verticalBorderChar - * - * @return $this - * - * @deprecated since Symfony 4.1, use {@link setVerticalBorderChars()} instead. - */ - public function setVerticalBorderChar($verticalBorderChar) - { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use setVerticalBorderChars() instead.', __METHOD__), E_USER_DEPRECATED); - - return $this->setVerticalBorderChars($verticalBorderChar, $verticalBorderChar); - } - - /** - * Gets vertical border character. - * - * @return string - * - * @deprecated since Symfony 4.1, use {@link getBorderChars()} instead. - */ - public function getVerticalBorderChar() - { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), E_USER_DEPRECATED); - - return $this->verticalOutsideBorderChar; - } - /** * Gets border characters. * @@ -259,22 +199,6 @@ class TableStyle return $this->setCrossingChars($char, $char, $char, $char, $char, $char, $char, $char, $char); } - /** - * Sets crossing character. - * - * @param string $crossingChar - * - * @return $this - * - * @deprecated since Symfony 4.1. Use {@link setDefaultCrossingChar()} instead. - */ - public function setCrossingChar($crossingChar) - { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1. Use setDefaultCrossingChar() instead.', __METHOD__), E_USER_DEPRECATED); - - return $this->setDefaultCrossingChar($crossingChar); - } - /** * Gets crossing character. * diff --git a/src/Symfony/Component/Console/Output/ConsoleOutputInterface.php b/src/Symfony/Component/Console/Output/ConsoleOutputInterface.php index f4c2fa623a..6b6635f580 100644 --- a/src/Symfony/Component/Console/Output/ConsoleOutputInterface.php +++ b/src/Symfony/Component/Console/Output/ConsoleOutputInterface.php @@ -16,8 +16,6 @@ namespace Symfony\Component\Console\Output; * This adds information about stderr and section output stream. * * @author Dariusz Górecki - * - * @method ConsoleSectionOutput section() Creates a new output section */ interface ConsoleOutputInterface extends OutputInterface { @@ -29,4 +27,6 @@ interface ConsoleOutputInterface extends OutputInterface public function getErrorOutput(); public function setErrorOutput(OutputInterface $error); + + public function section(): ConsoleSectionOutput; } diff --git a/src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php b/src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php index 3baebef81b..a959e9eebb 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/DebugHandlersListener.php @@ -17,7 +17,6 @@ use Symfony\Component\Console\Event\ConsoleEvent; use Symfony\Component\Console\Output\ConsoleOutputInterface; use Symfony\Component\Debug\ErrorHandler; use Symfony\Component\Debug\ExceptionHandler; -use Symfony\Component\EventDispatcher\Event; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Debug\FileLinkFormatter; use Symfony\Component\HttpKernel\Event\KernelEvent; @@ -65,7 +64,7 @@ class DebugHandlersListener implements EventSubscriberInterface /** * Configures the error handler. */ - public function configure(Event $event = null) + public function configure(object $event = null) { if (!$event instanceof KernelEvent ? !$this->firstCall : !$event->isMasterRequest()) { return;