mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Simplify how options are checked.
This commit is contained in:
parent
e080bb27b9
commit
5e495ad90c
1 changed files with 6 additions and 1 deletions
|
@ -465,7 +465,12 @@ class Shell extends Object {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_array($options)) {
|
if (is_array($options)) {
|
||||||
while ($in === '' || !(in_array(strtolower($in), $options) || in_array(strtoupper($in), $options) || in_array($in, $options))) {
|
$options = array_merge(
|
||||||
|
array_map('strtolower', $options),
|
||||||
|
array_map('strtoupper', $options),
|
||||||
|
$options
|
||||||
|
);
|
||||||
|
while ($in === '' || !in_array($in, $options)) {
|
||||||
$in = $this->_getInput($prompt, $options, $default);
|
$in = $this->_getInput($prompt, $options, $default);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue