From 22db5ad1ffb0ea40f163dbf2e6deb11310df6391 Mon Sep 17 00:00:00 2001 From: Roman Anasal Date: Wed, 4 Aug 2021 00:36:17 +0200 Subject: [PATCH] [FrameworkBundle] remove dead conditions in Translation Commands Since $targetPath is directly set just 3 lines above !isset($targetPath[1]) will *always* evaluate to true. This check was originally to support legacy paths which was removed in b6eb1f4979db346ffe9fe7f6a5f335323f0c7175 --- .../Bundle/FrameworkBundle/Command/TranslationDebugCommand.php | 2 +- .../Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php index f8fa23fd68afc..95cf7bf7d9259 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php @@ -165,7 +165,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $transPaths = [$path.'/translations']; $codePaths = [$path.'/templates']; - if (!is_dir($transPaths[0]) && !isset($transPaths[1])) { + if (!is_dir($transPaths[0])) { throw new InvalidArgumentException(sprintf('"%s" is neither an enabled bundle nor a directory.', $transPaths[0])); } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php index c849538173d0f..ee250f18f5ddb 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php @@ -197,7 +197,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $transPaths = [$path.'/translations']; $codePaths = [$path.'/templates']; - if (!is_dir($transPaths[0]) && !isset($transPaths[1])) { + if (!is_dir($transPaths[0])) { throw new InvalidArgumentException(sprintf('"%s" is neither an enabled bundle nor a directory.', $transPaths[0])); } }