diff --git a/src/Symfony/Bridge/Twig/CHANGELOG.md b/src/Symfony/Bridge/Twig/CHANGELOG.md index 7227605312..c37b0f0f15 100644 --- a/src/Symfony/Bridge/Twig/CHANGELOG.md +++ b/src/Symfony/Bridge/Twig/CHANGELOG.md @@ -7,6 +7,7 @@ CHANGELOG * removed `TwigEngine` class, use `\Twig\Environment` instead. * removed `transChoice` filter and token * `HttpFoundationExtension` requires a `UrlHelper` on instantiation + * removed support for implicit STDIN usage in the `lint:twig` command, use `lint:twig -` (append a dash) instead to make it explicit. 4.4.0 ----- diff --git a/src/Symfony/Bridge/Twig/Command/LintCommand.php b/src/Symfony/Bridge/Twig/Command/LintCommand.php index 3e76b36dfa..90955f8dba 100644 --- a/src/Symfony/Bridge/Twig/Command/LintCommand.php +++ b/src/Symfony/Bridge/Twig/Command/LintCommand.php @@ -77,17 +77,12 @@ EOF { $io = new SymfonyStyle($input, $output); $filenames = $input->getArgument('filename'); - $hasStdin = '-' === ($filenames[0] ?? ''); - if ($hasStdin || 0 === \count($filenames)) { - if ($hasStdin || 0 === ftell(STDIN)) { // remove 0 === ftell(STDIN) check in 5.0 - if (!$hasStdin) { - @trigger_error('Calling to the "lint:twig" command providing pipe file content to STDIN without passing the dash symbol "-" explicitly is deprecated since Symfony 4.4.', E_USER_DEPRECATED); - } - - return $this->display($input, $output, $io, [$this->validate($this->getStdin(), uniqid('sf_', true))]); - } + if ('-' === ($filenames[0] ?? '')) { + return $this->display($input, $output, $io, [$this->validate($this->getStdin(), uniqid('sf_', true))]); + } + if (0 === \count($filenames)) { $loader = $this->twig->getLoader(); if ($loader instanceof FilesystemLoader) { $paths = []; diff --git a/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php b/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php index 3ac46512f1..fe3a7231b4 100644 --- a/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php @@ -66,9 +66,6 @@ class LintCommandTest extends TestCase $this->assertRegExp('/ERROR in \S+ \(line /', trim($tester->getDisplay())); } - /** - * @group tty - */ public function testLintDefaultPaths() { $tester = $this->createCommandTester(); diff --git a/src/Symfony/Component/Translation/CHANGELOG.md b/src/Symfony/Component/Translation/CHANGELOG.md index 79d3a46e4e..3f3d81cd55 100644 --- a/src/Symfony/Component/Translation/CHANGELOG.md +++ b/src/Symfony/Component/Translation/CHANGELOG.md @@ -14,6 +14,7 @@ CHANGELOG * removed `FileDumper::setBackup()` and `TranslationWriter::disableBackup()` * removed `MessageFormatter::choiceFormat()` * added argument `$filename` to `PhpExtractor::parseTokens()` + * removed support for implicit STDIN usage in the `lint:xliff` command, use `lint:xliff -` (append a dash) instead to make it explicit. 4.4.0 ----- diff --git a/src/Symfony/Component/Translation/Command/XliffLintCommand.php b/src/Symfony/Component/Translation/Command/XliffLintCommand.php index 8137415e99..c77c2fa556 100644 --- a/src/Symfony/Component/Translation/Command/XliffLintCommand.php +++ b/src/Symfony/Component/Translation/Command/XliffLintCommand.php @@ -83,20 +83,15 @@ EOF $filenames = (array) $input->getArgument('filename'); $this->format = $input->getOption('format'); $this->displayCorrectFiles = $output->isVerbose(); - $hasStdin = '-' === ($filenames[0] ?? ''); - - if ($hasStdin || 0 === \count($filenames)) { - if (!$hasStdin && 0 !== ftell(STDIN)) { // remove 0 !== ftell(STDIN) check in 5.0 - throw new RuntimeException('Please provide a filename or pipe file content to STDIN.'); - } - - if (!$hasStdin) { - @trigger_error('Calling to the "lint:xliff" command providing pipe file content to STDIN without passing the dash symbol "-" explicitly is deprecated since Symfony 4.4.', E_USER_DEPRECATED); - } + if ('-' === ($filenames[0] ?? '')) { return $this->display($io, [$this->validate($this->getStdin())]); } + if (0 === \count($filenames)) { + throw new RuntimeException('Please provide a filename or pipe file content to STDIN.'); + } + $filesInfo = []; foreach ($filenames as $filename) { if (!$this->isReadable($filename)) { diff --git a/src/Symfony/Component/Yaml/CHANGELOG.md b/src/Symfony/Component/Yaml/CHANGELOG.md index 0879b28a45..5627178c73 100644 --- a/src/Symfony/Component/Yaml/CHANGELOG.md +++ b/src/Symfony/Component/Yaml/CHANGELOG.md @@ -5,6 +5,7 @@ CHANGELOG ----- * Removed support for mappings inside multi-line strings. + * removed support for implicit STDIN usage in the `lint:yaml` command, use `lint:yaml -` (append a dash) instead to make it explicit. 4.4.0 ----- diff --git a/src/Symfony/Component/Yaml/Command/LintCommand.php b/src/Symfony/Component/Yaml/Command/LintCommand.php index 2f3193ba1d..32b2350dc9 100644 --- a/src/Symfony/Component/Yaml/Command/LintCommand.php +++ b/src/Symfony/Component/Yaml/Command/LintCommand.php @@ -86,20 +86,15 @@ EOF $this->format = $input->getOption('format'); $this->displayCorrectFiles = $output->isVerbose(); $flags = $input->getOption('parse-tags') ? Yaml::PARSE_CUSTOM_TAGS : 0; - $hasStdin = '-' === ($filenames[0] ?? ''); - - if ($hasStdin || 0 === \count($filenames)) { - if (!$hasStdin && 0 !== ftell(STDIN)) { // remove 0 !== ftell(STDIN) check in 5.0 - throw new RuntimeException('Please provide a filename or pipe file content to STDIN.'); - } - - if (!$hasStdin) { - @trigger_error('Calling to the "lint:yaml" command providing pipe file content to STDIN without passing the dash symbol "-" explicitly is deprecated since Symfony 4.4.', E_USER_DEPRECATED); - } + if ('-' === ($filenames[0] ?? '')) { return $this->display($io, [$this->validate($this->getStdin(), $flags)]); } + if (0 === \count($filenames)) { + throw new RuntimeException('Please provide a filename or pipe file content to STDIN.'); + } + $filesInfo = []; foreach ($filenames as $filename) { if (!$this->isReadable($filename)) {