public function option($name = null, $config = [], $value = null)
{
$defaults = ['type' => 'string', 'group' => false, 'array' => false, 'value' => null, 'default' => null];
if (func_num_args() === 1) {
if (isset($this->_options[$name])) {
return $this->_options[$name];
}
return $defaults;
}
$config = is_array($config) ? $config + $defaults : [$config => $value] + $this->option($name);
$this->_options[$name] = $config;
list($key, $extra) = $this->_splitOptionName($name);
if ($extra) {
$this->option($key, ['group' => true, 'array' => true]);
}
if ($config['default'] !== null) {
$this->_defaults[$key][$extra] = $this->_get($name);
}
return $config;
}