feat(recent-files): handle invalid config when only min or max are set for recent files limit

Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
This commit is contained in:
Cristian Scheid 2026-03-23 10:55:21 -03:00 committed by backportbot[bot]
parent 229a3bbf0a
commit f5df0a132f

View file

@ -159,6 +159,8 @@ class UserConfig {
if ((int)$value < $config['min'] || (int)$value > $config['max']) {
throw new \InvalidArgumentException('Invalid config value');
}
} elseif (isset($config['min']) || isset($config['max'])) {
throw new \InvalidArgumentException('Invalid config definition: min and max must both be defined');
} elseif (!in_array($value, $this->getAllowedConfigValues($key))) {
throw new \InvalidArgumentException('Invalid config value');
}