Skip to content

Commit

Permalink
ExplainCommand: drop redundant option checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mabar committed Mar 22, 2024
1 parent 0e691cf commit 6ceec97
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
10 changes: 0 additions & 10 deletions src/Command/ExplainCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,6 @@ private function validateOptions(InputInterface $input, OutputInterface $output)
$output->writeln("<error>Option --seconds expects an int<0, 59>, '$seconds' given.</error>");
}

if ($id !== null) {
$hasErrors = true;
$output->writeln('<error>Option --seconds cannot be used with --id.</error>');
}

if ($expression === null) {
$hasErrors = true;
$output->writeln('<error>Option --seconds must be used with --expression.</error>');
Expand All @@ -134,11 +129,6 @@ private function validateOptions(InputInterface $input, OutputInterface $output)
$timezone = new DateTimeZone($timezone);
}

if ($id !== null) {
$hasErrors = true;
$output->writeln('<error>Option --timezone cannot be used with --id.</error>');
}

if ($expression === null) {
$hasErrors = true;
$output->writeln('<error>Option --timezone must be used with --expression.</error>');
Expand Down
2 changes: 0 additions & 2 deletions tests/Unit/Command/ExplainCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 6ceec97

Please sign in to comment.