From 4bae9aa3dacca2f3aabf5860d28e26d907f24736 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 25 May 2017 10:45:41 +0200 Subject: [PATCH] [Console] remove remaining deprecated features --- src/Symfony/Component/Console/CHANGELOG.md | 1 + .../Component/Console/Formatter/OutputFormatter.php | 8 +------- .../Console/Tests/Formatter/OutputFormatterTest.php | 11 ----------- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/Symfony/Component/Console/CHANGELOG.md b/src/Symfony/Component/Console/CHANGELOG.md index 3952997e64ee..fdf77cb8a57e 100644 --- a/src/Symfony/Component/Console/CHANGELOG.md +++ b/src/Symfony/Component/Console/CHANGELOG.md @@ -4,6 +4,7 @@ CHANGELOG 4.0.0 ----- + * `OutputFormatter` throws an exception when unknown options are used * removed `QuestionHelper::setInputStream()/getInputStream()` * removed `Application::getTerminalWidth()/getTerminalHeight()` and `Application::setTerminalDimensions()/getTerminalDimensions()` diff --git a/src/Symfony/Component/Console/Formatter/OutputFormatter.php b/src/Symfony/Component/Console/Formatter/OutputFormatter.php index d32f0915de01..2befd74ea7f8 100644 --- a/src/Symfony/Component/Console/Formatter/OutputFormatter.php +++ b/src/Symfony/Component/Console/Formatter/OutputFormatter.php @@ -211,13 +211,7 @@ private function createStyleFromString($string) preg_match_all('([^,;]+)', $match[1], $options); $options = array_shift($options); foreach ($options as $option) { - try { - $style->setOption($option); - } catch (\InvalidArgumentException $e) { - @trigger_error(sprintf('Unknown style options are deprecated since version 3.2 and will be removed in 4.0. Exception "%s".', $e->getMessage()), E_USER_DEPRECATED); - - return false; - } + $style->setOption($option); } } else { return false; diff --git a/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php b/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php index 4b11028be5e3..05647cd258a7 100644 --- a/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php +++ b/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php @@ -193,17 +193,6 @@ public function provideInlineStyleOptionsCases() ); } - /** - * @group legacy - * @dataProvider provideInlineStyleTagsWithUnknownOptions - * @expectedDeprecation Unknown style options are deprecated since version 3.2 and will be removed in 4.0. Exception "Invalid option specified: "%s". Expected one of (bold, underscore, blink, reverse, conceal)". - */ - public function testInlineStyleOptionsUnknownAreDeprecated($tag, $option) - { - $formatter = new OutputFormatter(true); - $formatter->format($tag); - } - public function provideInlineStyleTagsWithUnknownOptions() { return array(