Validates that all required parameters are set, otherwise throws an exception

@param array $parameters
@param array $requiredParameters List of required parameters
@throws RequiredParameterMissingException
333017
protected function assertParametersAreValid(array $parameters, array $requiredParameters)
    {
        foreach ($requiredParameters as $parameter) {
            if (empty($parameters[$parameter])) {
                throw RequiredParameterMissingException::withParameter($parameter);
            }
        }
    }
888489
public function setParameters($parameters)
    {
        parent::setParameters($parameters);
        if ($parameters !== null) {
            for ($i = 0, $len = count($parameters); $i < $len; $i++) {
                $paramname = $parameters[$i]->getName();
                switch (strtolower($paramname)) {
                    case self::NAME_KEY:
                        $this->setName($parameters[$i]->getValue());
                        break;
                    case self::CASE_KEY:
                        $this->setCasesensitive(Project::toBoolean($parameters[$i]->getValue()));
                        break;
                    case self::NEGATE_KEY:
                        $this->setNegate(Project::toBoolean($parameters[$i]->getValue()));
                        break;
                    case self::REGEX_KEY:
                        $this->setRegex($parameters[$i]->getValue());
                        break;
                    default:
                        $this->setError("Invalid parameter " . $paramname);
                }
            } // for each param
        } // if params
    }
194605
public function removeParameters(array $parameters = null)
  {
    $this->parameters = array();

    if ($parameters) {
      $this->addParameters($parameters);
    }

    return $this;
  }
882501
public function validateConstraints(array $constraints, Parameter $parameter)
  {
    try
    {
      $violationList = $this->validator->validate(
        $parameter->getValue(),
        $constraints
      );
    }
    catch (\Exception $e)
    {
      $this->dispatcher->dispatch(TransformerEvents::ON_EXCEPTION, new ExceptionEvent($e));
      $violationList = $this->handleException($e, $parameter);
    }

    if ($violationList->count() > 0)
    {
      $invalidValue = $violationList->get(0)->getInvalidValue();
      if (is_array($invalidValue))
      {
        $invalidValue = '[' . implode(', ', $invalidValue) . ']';
      }
      throw new TransformerException(
        'Key: ' . $parameter->getKey() . ' - ' . 'Value: '
        . $invalidValue . ' - Error: '
        . $violationList->get(0)->getMessage()
      );
    }
  }
877953
protected function check(array $sessionParameters, $parameter)
    {
        if (empty($sessionParameters[$parameter])) {
            throw new CmisInvalidArgumentException(sprintf('Parameter "%s" is missing!', $parameter));
        }

        return true;
    }
177873
private function checkRequestConsistence(array $provided_parameters) {

        $signatures = $this->registered_method->getSignatures(false);

        $provided_parameters_count = count($provided_parameters);

        foreach ( $signatures as $num=>$signature ) {

            $requested_parameters_count = count($signature["PARAMETERS"]);

            if ( $provided_parameters_count != $requested_parameters_count ) {

                continue;

            }

            $index = 0;

            foreach ( $signature["PARAMETERS"] as $parameter => $type ) {

                if ( !Validator::validate($provided_parameters[$index], $type) ) continue 2;

                $index += 1;

            }

            return $num;

        }

        throw new RpcException("Invalid params", -32602);

    }
126409
private function validateAndSetBotParamsVital(array $params)
    {
        foreach (self::$valid_vital_bot_params as $vital_key) {
            if (!array_key_exists($vital_key, $params)) {
                throw new InvalidParamsException('Some vital info is missing: ' . $vital_key);
            }

            $this->bot_params[$vital_key] = $params[$vital_key];
        }
    }
1277046
public function registerParameters($parameters)
	{
		foreach ($parameters as $parameter => $value) {
			if (property_exists($this, $parameter)) {
				$this->$parameter = $value;
			}
		}
	}
78735
public function add(array $parameters)
    {
        foreach ($parameters as $key => $value) {
            $this->set($key, $value);
        }
    }
305988
protected function setParameters(array $parameters = array())
    {
        foreach ($parameters as $parameterKey => $parameterValue) {
            $this->container->setParameter($parameterKey, $parameterValue);
        }
    }
328611
public function setParameters($parameters)
    {
        // type check, error must never occur, bad code of it does
        if (!is_array($parameters)) {
            throw new Exception("Expected parameters array got something else");
        }

        $this->_parameters = $parameters;
        $this->setInitialized(false);
    }
656264
protected function _validateParams(array $params) {
        $config = new Garp_Util_Configuration($params);
        $config->obligate('to');
        $config->obligate('subject');

        if (!isset($params['message']) && !isset($params['htmlMessage'])) {
            throw new Garp_Util_Configuration_Exception(
                sprintf(
                    Garp_Util_Configuration::EXCEPTION_MISSINGKEY,
                    'message OR htmlMessage'
                )
            );
        }
    }
597691
private function requireParameterCount(int $count, array $parameters, string $rule): void
    {
        if (count($parameters) < $count) {
            throw new InvalidArgumentException("Validation rule {$rule} requires at least {$count} parameters.");
        }
    }
517449
protected function validateRequiredParameters(array $required, array $params)
    {
        foreach ($required as $param) {
            if (!isset($params[$param])) {
                throw new MissingArgumentException(sprintf('The "%s" parameter is required.', $param));
            }
        }
    }
514046
public function setParameters($parameters)
    {
        parent::setParameters($parameters);
        if ($parameters !== null) {
            for ($i = 0, $size = count($parameters); $i < $size; $i++) {
                $paramname = $parameters[$i]->getName();
                switch (strtolower($paramname)) {
                    case self::MIN_KEY:
                        $this->setMin($parameters[$i]->getValue());
                        break;
                    case self::MAX_KEY:
                        $this->setMax($parameters[$i]->getValue());
                        break;

                    default:
                        $this->setError("Invalid parameter " . $paramname);
                } // switch
            }
        }
    }
1304657
public function parameters(array $parameters)
    {
        foreach ($parameters as $parameter => $value) {
            if (property_exists($this->parameters, $parameter)) {
                $this->parameters->{$parameter} = $value;
            }
        }

        return $this;
    }
87873
public function setParameters($parameters)
    {
        parent::setParameters($parameters);
        if ($parameters !== null) {
            for ($i = 0, $size = count($parameters); $i < $size; $i++) {
                $paramname = $parameters[$i]->getName();
                switch (strtolower($paramname)) {
                    case self::MILLIS_KEY:
                        $this->setMillis($parameters[$i]->getValue());
                        break;
                    case self::DATETIME_KEY:
                        $this->setDatetime($parameters[$i]->getValue());
                        break;
                    case self::CHECKDIRS_KEY:
                        $this->setCheckdirs($parameters[$i]->getValue());
                        break;
                    case self::GRANULARITY_KEY:
                        $this->setGranularity($parameters[$i]->getValue());
                        break;
                    case self::WHEN_KEY:
                        $this->setWhen($parameters[$i]->getValue());
                        break;
                    default:
                        $this->setError("Invalid parameter " . $paramname);
                } // switch
            }
        }
    }