protected function getArrayOption($option, $property, $singular, $fallback = false)
{
$input = $this->input->getOption($option);
// fall back to whole list if fallback is set
if (!$input || count($input) === 0) {
if ($fallback) {
$input = $this->{$property};
} else {
$input = null;
}
}
if (null !== $input) {
foreach ($input as $value) {
if (!in_array($value, $this->{$property})) {
$message = sprintf('Invalid %s: %s', $singular, $value);
throw new \InvalidArgumentException($message);
}
}
}
return $input;
}