Checks whether all required values for the configuration have been set after the merge.

@param array $config
@param array $required
@return bool
180635
protected function isParsedConfigValid(array $config, array $required)
    {
        $inConfig = count(array_intersect_key(array_flip($required), array_filter($config)));

        return $inConfig === count($required);
    }
919394
protected function validateConfig(array $config)
    {
        // For now it's only required to pass a filter form type class.
        // If you don't want to use a defined form type class,
        // you can override the FormCreator object, implement FormCreatorInterface and customize it.
        $requiredKeys = ['form_filter_type_class'];

        foreach ($requiredKeys as $key) {
            if (!array_key_exists($key, $config)) {
                throw new FormCreatorException(sprintf(
                    'Key "%s" must be presented in the filters configuration.', $key
                ));
            }

            if (!class_exists($config[$key])) {
                throw new FormCreatorException(sprintf('Class "%s" is not found.', $config[$key]));
            }
        }
    }
1002102
protected function needsSlugging(string $attribute, array $config): bool
    {
        if (
            $config['onUpdate'] === true ||
            empty($this->model->getAttributeValue($attribute))
        ) {
            return true;
        }

        if ($this->model->isDirty($attribute)) {
            return false;
        }

        return (!$this->model->exists);
    }
434524
protected function checkConfig(array $config): void
    {
        foreach (['host', 'username', 'password', 'database', 'persistent'] as $key) {
            if (!isset($config[$key])) {
                $class = get_class($this);
                throw new ConfigException("Missing configuration key={$key} in {$class}");
            }
        }
    }
924755
protected function validateS3Config(array $config, array $requiredKeys)
    {
        foreach ($requiredKeys as $requiredKey) {
            if (!array_key_exists($requiredKey, $config)) {
                throw new InvalidConfigException($requiredKey);
            }
        }
    }
554353
private function _checkConfig($config = null)
    {
        if ($config === null) {
            $config = $this->config;
        }
        if (!($config instanceof ArrayAccess)
            && !is_array($config)
        ) {
            throw new Klarna_IncompleteConfigurationException;
        }
    }
839100
public function check(array $config): bool
    {
        // we dont use the phpversion function because that adds more data to the number (Like: -1+ubuntu16.04)
        // that conflicts with the semver check
        return Semver::satisfies(
            PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION,
            $this->getRequiredPhpConstraint()
        );
    }
794634
public static function setConfig($config = [])
    {
        if (!is_array($config)) {
            return false;
        }
        self::$config = array_merge(self::$config, $config);
        return true;
    }
364418
protected function required_options($required, $options = array())
  {
      $required = explode(',', $required);
      foreach ($required as $r) {
          if (!array_key_exists(trim($r), $options)) {
              throw new Exception($r.' parameter is required!');
              break;

              return false;
          }
      }

      return true;
  }
304417
private function mergeConfigParams(array $config)
    {
        foreach ($config as $name => $value) {
            preg_match('/^extend~(.*)~(.*)$/', $name, $matches);

            if (3 === count($matches)) {
                if (!isset($config[$matches[1]])) {
                    throw new ConfigurationException(sprintf('Unable to find parameter "%s" for extending.', $matches[1]));
                }
                if (!is_array($config[$matches[1]])) {
                    throw new ConfigurationException(
                        sprintf('Unable to extend parameter "%s": only array parameters can be extended.', $matches[1])
                    );
                }

                $config[$matches[2]] = $this->mergeConfigs($config[$matches[1]], $value);

                unset($config[$name]);

                continue;
            }
            if (is_array($value)) {
                $config[$name] = $this->mergeConfigParams($value);
            }
        }

        return $config;
    }
1224131
protected function doSetup($config = array())
    {
        // Catch the configuration file path
        if (isset($config[self::CONFIG_KEY_FILE_PATH])) {
            $this->configFilePath = $config[self::CONFIG_KEY_FILE_PATH];
        } else {
            // Also consider throwing an exception here instead
            // of failing silently
            return $config;
        }

        // Catch the context
        if (isset($config[ConfigInterface::KEY_CONTEXT])) {
            $this->context = $config[ConfigInterface::KEY_CONTEXT];
        }

        return $this->readConfigurationFiles();
    }
1188084
protected function checkConfig(array $config)
    {
        if (!isset($config['dataSource']) || !is_array($config['dataSource'])) {
            throw new UnexpectedValueException($this->translate(
                'Information about data source in metadata configuration should be an array or Traversable.'
            ));
        }
        if (!isset($config['types']) || !is_array($config['types'])) {
            throw new UnexpectedValueException($this->translate(
                'Information about types in metadata configuration should be an array or Traversable.'
            ));
        }
        if (!isset($config['fields']) || !is_array($config['fields'])) {
            throw new UnexpectedValueException($this->translate(
                'Information about fields in metadata configuration should be an array or Traversable.'
            ));
        }
    }
12701
static public function validateClientConfig(array $config)
    {
        $tags = [static::T8700, static::T8915, static::T8914];

        foreach ($tags as $tag) {
            if (!array_key_exists($tag, $config) || empty($config[$tag])) {
                throw new InvalidArgumentException("Please configure value for tag " . $tag);
            }
        }
    }
1041946
public function config($config)
    {
        if (is_array($config)) {
            $this->config = array_merge($this->config, $config);
        } elseif (isset($this->config[$config])) {
            return $this->config[$config];
        } else {
            return;
        }
    }
279528
protected function applyCommonConfiguration($config)
    {
        $this->columnName = isset($config['columnName']) ? strval($config['columnName']) : $this->name;

        if (isset($config['visible'])) {
            $this->isVisible = (bool) $config['visible'];
        }
        if (isset($config['readOnly'])) {
            $this->isReadOnly = (bool) $config['readOnly'];
        }
        if (isset($config['defaultValue'])) {
            $this->defaultValue = $config['defaultValue'];
        }
        if (isset($config['accessor'])) {
            $this->accessor = strval($config['accessor']);
        }
        if (isset($config['mutator'])) {
            $this->mutator = strval($config['mutator']);
        }

        if (isset($config['validators'])) {
            $validators = $config['validators'];
            if (!is_array($validators)) {
                throw new UnexpectedValueException($this->translate(
                    'Field validators configuration should be an array.'
                ));
            }
            $this->validators = $validators;
        }

        if (isset($config['filters'])) {
            $filters = $config['filters'];
            if (!is_array($filters)) {
                throw new UnexpectedValueException($this->translate(
                    'Field filters configuration should be an array.'
                ));
            }
            $this->filters = $filters;
        }
    }
1219718
protected function _checkRequiredOptions(array $config)
    {
        // we need at least a dbname
        if (! array_key_exists('dbname', $config)) {
            /** @see Zend_Db_Adapter_Exception */
            // require_once 'Zend/Db/Adapter/Exception.php';
            throw new Zend_Db_Adapter_Exception("Configuration array must have a key for 'dbname' that names the database instance");
        }

        if (! array_key_exists('password', $config) && array_key_exists('username', $config)) {
            /**
             * @see Zend_Db_Adapter_Exception
             */
            // require_once 'Zend/Db/Adapter/Exception.php';
            throw new Zend_Db_Adapter_Exception("Configuration array must have a key for 'password' for login credentials.
                                                If Windows Authentication is desired, both keys 'username' and 'password' should be ommited from config.");
        }

        if (array_key_exists('password', $config) && !array_key_exists('username', $config)) {
            /**
             * @see Zend_Db_Adapter_Exception
             */
            // require_once 'Zend/Db/Adapter/Exception.php';
            throw new Zend_Db_Adapter_Exception("Configuration array must have a key for 'username' for login credentials.
                                                If Windows Authentication is desired, both keys 'username' and 'password' should be ommited from config.");
        }
    }
1274106
public function requireIfAvailableAnd(Configuration $configuration, array $params)
  {
    $requiredIfAvailable = $configuration->getOptions()->getRequiredIfAvailable();
    if (is_array($requiredIfAvailable->getAnd()) && count($requiredIfAvailable->getAnd()) > 0)
    {
      foreach ($requiredIfAvailable->getAnd() as $key)
      {
        if (!array_key_exists(strtolower($key), $params))
        {
          return false;
          break;
        }
      }

      return true;
    }

    return false;
  }