From 6ceec977b9ac4aee68bc8e6f0eb3eb8a8d368644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Barto=C5=A1?= Date: Fri, 22 Mar 2024 23:36:44 +0100 Subject: [PATCH] ExplainCommand: drop redundant option checks --- src/Command/ExplainCommand.php | 10 ---------- tests/Unit/Command/ExplainCommandTest.php | 2 -- 2 files changed, 12 deletions(-) diff --git a/src/Command/ExplainCommand.php b/src/Command/ExplainCommand.php index b898df0..bc411e1 100644 --- a/src/Command/ExplainCommand.php +++ b/src/Command/ExplainCommand.php @@ -113,11 +113,6 @@ private function validateOptions(InputInterface $input, OutputInterface $output) $output->writeln("Option --seconds expects an int<0, 59>, '$seconds' given."); } - if ($id !== null) { - $hasErrors = true; - $output->writeln('Option --seconds cannot be used with --id.'); - } - if ($expression === null) { $hasErrors = true; $output->writeln('Option --seconds must be used with --expression.'); @@ -134,11 +129,6 @@ private function validateOptions(InputInterface $input, OutputInterface $output) $timezone = new DateTimeZone($timezone); } - if ($id !== null) { - $hasErrors = true; - $output->writeln('Option --timezone cannot be used with --id.'); - } - if ($expression === null) { $hasErrors = true; $output->writeln('Option --timezone must be used with --expression.'); diff --git a/tests/Unit/Command/ExplainCommandTest.php b/tests/Unit/Command/ExplainCommandTest.php index 9df2ad2..c6531b0 100644 --- a/tests/Unit/Command/ExplainCommandTest.php +++ b/tests/Unit/Command/ExplainCommandTest.php @@ -393,10 +393,8 @@ public function provideInputError(): Generator ], <<<'MSG' Option --seconds expects an int<0, 59>, 'bad seconds' given. -Option --seconds cannot be used with --id. Option --seconds must be used with --expression. Option --timezone expects a valid timezone, 'bad timezone' given. -Option --timezone cannot be used with --id. Option --timezone must be used with --expression. Option --language expects no value or one of supported languages, 'noop' given. Use --help to list available languages. Option --language must be used with --expression.