diff --git a/src/Symfony/Bridge/Twig/CHANGELOG.md b/src/Symfony/Bridge/Twig/CHANGELOG.md index 7227605312c9..c37b0f0f1552 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 3e76b36dfa5c..90955f8dbadc 100644 --- a/src/Symfony/Bridge/Twig/Command/LintCommand.php +++ b/src/Symfony/Bridge/Twig/Command/LintCommand.php @@ -77,17 +77,12 @@ protected function execute(InputInterface $input, OutputInterface $output) { $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 3ac46512f182..fe3a7231b4e8 100644 --- a/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php @@ -66,9 +66,6 @@ public function testLintFileCompileTimeException() $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 79d3a46e4ec0..3f3d81cd55b7 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 8137415e9927..c77c2fa55691 100644 --- a/src/Symfony/Component/Translation/Command/XliffLintCommand.php +++ b/src/Symfony/Component/Translation/Command/XliffLintCommand.php @@ -83,20 +83,15 @@ protected function execute(InputInterface $input, OutputInterface $output) $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 0879b28a45cf..5627178c7324 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 2f3193ba1d24..32b2350dc953 100644 --- a/src/Symfony/Component/Yaml/Command/LintCommand.php +++ b/src/Symfony/Component/Yaml/Command/LintCommand.php @@ -86,20 +86,15 @@ protected function execute(InputInterface $input, OutputInterface $output) $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)) {
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: