Checks that the config contains all needed options.

@throws \InvalidArgumentException
765564
public function isValidConfig()
    {
        $missing = [];

        foreach ($this->required as $required) {
            if (!array_key_exists($required, $this->txpcfg)) {
                $missing[] = $required;
            }
        }

        if ($missing) {
            throw new \InvalidArgumentException(
                'Textpattern installation missing config values: '.implode(', ', $missing)
            );
        }
    }
18677
protected function validateOptions(array $options)
    {
        foreach ($options as $option => $value) {
            if (!array_key_exists($option, $this->defaultOptions)) {
                throw new \InvalidArgumentException(sprintf('Unrecognized option "%s".', $option));
            }
        }
        if (isset($options['html']) && !is_bool($options['html'])) {
            throw new \InvalidArgumentException('The option "html" must be a boolean.');
        }
        if (isset($options['html_attributes']) && !is_array($options['html_attributes'])) {
            throw new \InvalidArgumentException('The option "html_attributes" must be an array.');
        }
    }
1270499
public function checkConfig()
    {
        $views = [
            $this->fullController,
            $this->action,
        ];

        $this->configIndex = implode('.', array_filter($views));

        return array_get(config('view-routing'), $this->configIndex);
    }
1360026
private function verifyConfig()
    {
        foreach (Config::KEYS as $key) {
            if (!isset(Config::get()[$key])) {
                throw new OrmException('Key "'.$key.'" is not given.');
            }
        }
    }
1008564
protected function validateOptions()
    {
        if (!isset($this->options['allowedTypes'])) {
            throw new InvalidValidationOptionsException('The option "allowedTypes" was not specified.', 1327947194);
        } elseif (!is_array($this->options['allowedTypes']) || $this->options['allowedTypes'] === []) {
            throw new InvalidValidationOptionsException('The option "allowedTypes" must be an array with at least one item.', 1327947224);
        }
    }
403992
public function checkCommandOptions()
    {
        foreach ($this->commandOptions as $option) {
            if ($option->isFlagOption()) {
                $parameters = $this->flagOptions;
            } else {
                $parameters = $this->options;
            }
            $option->addParameters($parameters);

            if ($option->isValueRequired() && $option->hasBeenProvided() && !$option->getValue()) {
                if ($option->isFlagOption()) {
                    $message = "Option '-{$option->getName()}' requires a value, which is not provided.";
                } else {
                    $message = "Option '--{$option->getName()}' requires a value, which is not provided.";
                }
                throw new \Parable\Console\Exception($message);
            }
        }
    }
542727
public function checkSetConfigInput()
    {
        
        $availableParameters = array('loaded', 'loadAtStartup', 'ghost');
        $defaults = array('extension' => null,
                          'configParameter' => null,
                          'configValue' => null);
                          
        $this->options = array_merge($defaults, $this->options);
        
        if ($this->options['configParameter'] == null){
            $this->error("Please provide the 'configParam' parameter.", true);
        }
        else if (!in_array($this->options['configParameter'], $availableParameters)){
            $this->error("Please provide a valid 'configParam' parameter value (" . implode("|", $availableParameters) . ").", true);
        }
        else if ($this->options['configValue'] === null){
            $this->error("Please provide the 'configValue' parameter.", true);
        }
        else if ($this->options['extension'] == null){
            $this->error("Please provide the 'extension' parameter.", true);
        }
    }
1195481
function validateConfig(config) {
    let missing = [];
    _.each(requiredOptions, function (option) {
      if (config[option] === undefined) {
        missing.push(option);
      }
    });
    if (missing.length > 0) {
      throw new Error('The following required parameters were not provided: ' + missing.join(','));
    }
  }
1372424
protected function checkOptions()
	{
	    $formatType = ucwords($this->options['data_format']);
	    $formatClass = '\\Wslim\\Common\\DataFormatter\\' . $formatType . 'Formatter';
	    if (!class_exists($formatClass)) {
	        throw new InvalidArgumentException('data_format => null|string|json|serialize|csv|tsv|xml');
	    }
	    if (!isset($this->options['ttl'])) $this->options['ttl'] = 0;
	    if (!$this->formatter) $this->formatter = new $formatClass;
	}
28728
public function hasOptions(array $options) {
        $all = true;

        foreach ($options as $option) {
            if (!isset($this->_options[$option])) {
                $all = false;
            }
        }

        return $all;
    }
1222750
public function prepareOptions()
    {
        foreach ($this->content as $key => $option) {
            if (!($option instanceof Option)) {
                throw new \InvalidArgumentException('List item should be an Windwalker\\Html\\Option object.');
            }

            if ($this->isChecked($option)) {
                $option['checked'] = 'checked';
            }

            $attrs = $option->getAttributes();

            $attrs['type'] = $this->type;
            $attrs['name'] = $this->getAttribute('name');

            $attrs['id'] = $option->getAttribute('id');
            $attrs['id'] = $attrs['id'] ?: strtolower(
                trim(
                    preg_replace(
                        '/[^A-Z0-9_\.-]/i',
                        '-',
                        $attrs['name'] ?: 'empty'
                    ),
                    '-'
                )
            );
            $attrs['id'] .= '-' . strtolower(
                trim(
                    preg_replace(
                        '/[^A-Z0-9_\.-]/i',
                        '-',
                        $option->getValue() ?: 'empty'
                    ),
                    '-'
                )
            );
            $attrs['id'] = 'input-' . $attrs['id'];
            $attrs['disabled'] = $this->disabled;
            $attrs['readonly'] = $this->readonly;

            // Do not affect source options
            $option = clone $option;

            $option->setAttributes($attrs);

            $input = new HtmlElement('input', null, $attrs);

            $option->setAttribute('disabled', null);
            $option->setAttribute('readonly', null);

            $label = $this->createLabel($option);

            $this->content[$key] = new HtmlElements([$input, $label]);
        }
    }
714283
protected function initConfig() {
		$config = Xml::read($this->file);

		if ($config->getName() !== 'container') {
			throw new InvalidConfig('Root element of a config must be a "container"', null, null, $config);
		}

		$this->override = ($config->override === 'true');
		
		$this->includes     = [];
		$this->parameters   = new stdClass();
		$this->services     = new stdClass();
		$this->initializers = new stdClass();
		
		foreach ($config->getContent() as $element) {
			$name = $element->getName();
			
			if ($name === 'includes') {
				$this->includes = array_merge($this->includes, $this->processIncludes($element));
				continue;
			}
			
			if ($name === 'parameters') {
				$this->parameters = Std::objectMerge($this->parameters, $this->processParameters($element));
				continue;
			}
			
			if ($name === 'services') {
				$this->services = Std::objectMerge($this->services, $this->processServices($element));
				continue;
			}
			
			if ($name === 'initializers') {
				$this->initializers = Std::objectMerge($this->initializers, $this->processInitializers($element));
				continue;
			}
			
			throw new InvalidConfig('Unknown element "' . $element->getName() . '" in container', null, null, $element->getName());
		}
	}
115534
protected function validateConfig()
    {
        $this->queueDriver = $this->createQueueDriver();
        $this->requiredFields = $this->queueDriver->getRequiredConfig();
        $this->config = array_merge($this->queueDriver->getDefaultConfig(), $this->config);
        parent::validateConfig();
    }
929117
protected function checkCallable()
    {
        $callback = $this->getConfig('callback');

        if (!is_callable($callback)) {
            throw new InvalidArgumentException(sprintf(
                'The `callback` option is not a callable. Got `%s` instead.',
                gettype($callback)
            ));
        }
    }
103580
public function validate($args)
    {
        $matched = false;

        //validates arguments
        foreach ($args as $arg => $value) {
            //non-named option are skipped from validation
            if (is_numeric($arg)) continue;
            //validates action options
            foreach ($this->options as $option) {
                //checks if options matches specified parameter
                if ($option->matchParam($arg)) {
                    //validates option
                    if (!$option->validate($value)) {
                        throw new InvalidArgumentException($arg, $value);
                    }
                    $matched = true;
                }
            }
            if (!$matched) {
                throw new InvalidOptionException($arg);
            }
        }
        //validates required options
        foreach ($this->options as $option) {
            if (!$option->isRequired()) {
                continue;
            }

            if (!$option->getValue($args)) {
                throw new MissingRequiredArgumentException($option->getName());
            }
        }

        return true;
    }
1362247
private function hasConfig($config, $attr)
    {
        return (isset($attr[self::CONFIG_ALL]) && $attr[self::CONFIG_ALL]) || (isset($attr[$config]) && $attr[$config]);
    }
1366584
protected function checkConfiguration()
    {
        return $this->getSelectSource()
            && $this->getValueColumn()
            && $this->getAliasColumn()
            && $this->getIdColumn()
            && $this->getSortingColumn();
    }