|
|
@@ -57,7 +57,7 @@ class ConsoleInputOption
|
|
|
/**
|
|
|
* Default value for the option
|
|
|
*
|
|
|
- * @var mixed
|
|
|
+ * @var string|bool
|
|
|
*/
|
|
|
protected $_default;
|
|
|
|
|
|
@@ -71,7 +71,7 @@ class ConsoleInputOption
|
|
|
/**
|
|
|
* An array of choices for the option.
|
|
|
*
|
|
|
- * @var array
|
|
|
+ * @var string[]
|
|
|
*/
|
|
|
protected $_choices;
|
|
|
|
|
|
@@ -82,7 +82,7 @@ class ConsoleInputOption
|
|
|
* @param string $short The short alias for this option
|
|
|
* @param string $help The help text for this option
|
|
|
* @param bool $boolean Whether this option is a boolean option. Boolean options don't consume extra tokens
|
|
|
- * @param string $default The default value for this option.
|
|
|
+ * @param string|bool $default The default value for this option.
|
|
|
* @param string[] $choices Valid choices for this option.
|
|
|
* @param bool $multiple Whether this option can accept multiple value definition.
|
|
|
* @throws \Cake\Console\Exception\ConsoleException
|
|
|
@@ -214,8 +214,8 @@ class ConsoleInputOption
|
|
|
/**
|
|
|
* Check that a value is a valid choice for this option.
|
|
|
*
|
|
|
- * @param string $value The choice to validate.
|
|
|
- * @return bool
|
|
|
+ * @param string|bool $value The choice to validate.
|
|
|
+ * @return true
|
|
|
* @throws \Cake\Console\Exception\ConsoleException
|
|
|
*/
|
|
|
public function validChoice($value)
|
|
|
@@ -223,7 +223,7 @@ class ConsoleInputOption
|
|
|
if (empty($this->_choices)) {
|
|
|
return true;
|
|
|
}
|
|
|
- if (!in_array($value, $this->_choices)) {
|
|
|
+ if (!in_array($value, $this->_choices, true)) {
|
|
|
throw new ConsoleException(
|
|
|
sprintf(
|
|
|
'"%s" is not a valid value for --%s. Please use one of "%s"',
|