Skip to content

Commit 1d67efa

Browse files
committed
Fix input validation by using only known config values
1 parent 005aa6b commit 1d67efa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/PHPSemVerChecker/Console/InputMerger.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,21 @@ public function merge(InputInterface $input, Configuration $config)
2323
if ($input->hasArgumentSet($argument)) {
2424
$config->set($argument, $value);
2525
} else {
26-
$input->setArgument($argument, $config->get($argument));
26+
$configValue = $config->get($argument);
27+
if ($configValue !== null) {
28+
$input->setArgument($argument, $configValue);
29+
}
2730
}
2831
}
2932

3033
foreach ($input->getOptions() as $option => $value) {
3134
if ($input->hasOptionSet($option)) {
3235
$config->set($option, $value);
3336
} else {
34-
$input->setOption($option, $config->get($option));
37+
$configValue = $config->get($option);
38+
if ($configValue !== null) {
39+
$input->setOption($option, $configValue);
40+
}
3541
}
3642
}
3743
}

0 commit comments

Comments
 (0)