Verify if the conversation can be done.

@throws MissingProviderException thrown if the provider is missing
@throws \RuntimeException thrown if to or from parameters are missing
183327
private function validate()
    {
        if (null === $this->provider) {
            throw new MissingProviderException('A provider must be set for converting a currency');
        }

        if (null === $this->from || null === $this->to) {
            throw new \RuntimeException('from and to parameters must be provided');
        }
    }
199540
protected function checkLanguageParameter() {
    if ($this->request->hasValue('language')) {
      $language = $this->request->getValue('language');
      if (!in_array($language, array_keys($this->localization->getSupportedLanguages()))) {
        $this->response->addError(ApplicationError::get('PARAMETER_INVALID',
                ['invalidParameters' => ['language']]));
        return false;
      }
    }
    return true;
  }
484231
static function checkRequiredParameters(array $given, array $required)
    {
        foreach ($required as $key) {
            if (!array_key_exists($key, $given)) {
                throw new MissingRequiredParameterException(
                        "Missing required parameter '$key'"
                );
            }
        }
    }
1157178
protected function handleProviders()
    {
        // register deferred providers
        foreach ($this->deferredProviders as $provider) {
            $this->app->registerDeferredProvider($provider);
        }

        if ($this->registerProvidersMethod === 'register') {
            $this->registerProviders();
        } elseif ($this->registerProvidersMethod === 'resolve') {
            $this->resolveProviders();
        } else {
            throw new \LogicException('registerProvidersMethod not valid');
        }
    }
1156867
private function checkArguments(Request $request)
    {
        if (null === $request->get('firstName')) {
            throw new MissingArgumentException($this->container->getParameter('sulu.model.contact.class'), 'username');
        }
        if (null === $request->get('lastName')) {
            throw new MissingArgumentException($this->container->getParameter('sulu.model.contact.class'), 'password');
        }
        if (null === $request->get('formOfAddress')) {
            throw new MissingArgumentException($this->container->getParameter('sulu.model.contact.class'), 'formOfAddress');
        }
    }
813669
protected function validateOptions()
    {
        if (!$this->hasOption('root_path') || empty($this->getOption('root_path'))) {
            throw new \common_exception_MissingParameter('root_path', __CLASS__);
        }
        if (!$this->hasOption('file_path') || empty($this->getOption('file_path'))) {
            throw new \common_exception_MissingParameter('file_path', __CLASS__);
        }
    }
39069
protected function verifySendParams() {
        $m = ' must be set in order to send transport content!';
        //common requirements
        if (!array_key_exists('ShipmentId', $this->options)) {
            $this->log('Shipment ID'.$m, 'Warning');
            return false;
        }
        if (!array_key_exists('IsPartnered', $this->options)) {
            $this->log('IsPartnered'.$m, 'Warning');
            return false;
        }
        if (!array_key_exists('ShipmentType', $this->options)) {
            $this->log('Shipment type'.$m, 'Warning');
            return false;
        }
        //requirements based on partnership and type
        $p = $this->options['IsPartnered'] == 'true';
        $sp = $this->options['ShipmentType'] == 'SP';
        $ltl = $this->options['ShipmentType'] == 'LTL';
        //options could be in four possible places, so a search is needed
        $foundCarrier = false;
        $foundPackages = false;
        $foundPro = false;
        $foundContact = false;
        $foundBoxCount = false;
        $foundReady = false;
        foreach ($this->options as $op=>$junk) {
            if(preg_match("#CarrierName#",$op)){
                $foundCarrier = true;
            }
            if(preg_match("#PackageList\.member\.1#",$op)){
                $foundPackages = true;
            }
            if(preg_match("#ProNumber#",$op)){
                $foundPro = true;
            }
            if(preg_match("#Contact\.Name#",$op)){
                $foundContact = true;
            }
            if(preg_match("#BoxCount#",$op)){
                $foundBoxCount = true;
            }
            if(preg_match("#FreightReadyDate#",$op)){
                $foundReady = true;
            }
        }
        if (!$p && !$foundCarrier) {
            $this->log('Carrier'.$m, 'Warning');
            return false;
        }
        if ($sp && !$foundPackages) {
            $this->log('Packages'.$m, 'Warning');
            return false;
        }
        if (!$p && $ltl && !$foundPro) {
            $this->log('PRO number'.$m, 'Warning');
            return false;
        }
        if ($p && $ltl && !$foundContact) {
            $this->log('Contact info'.$m, 'Warning');
            return false;
        }
        if ($p && $ltl && !$foundBoxCount) {
            $this->log('Box count'.$m, 'Warning');
            return false;
        }
        if ($p && $ltl && !$foundReady) {
            $this->log('Ready date'.$m, 'Warning');
            return false;
        }

        //all good
        return true;
    }
357630
public function getAsQuestion()
    {
        $question = new Question($this->getQuestionText(), $this->default);
        $question->setMaxAttempts($this->maxAttempts);
        $question->setValidator(function ($value) {
            if ($this->isEmpty($value) && $this->isRequired()) {
                throw new MissingValueException("'{$this->name}' is required");
            }
            $this->validate($value);

            return $value;
        });
        $question->setAutocompleterValues($this->autoCompleterValues);

        return $question;
    }
1092914
protected function missingInformation()
    {
        foreach( $this->required as $data => $value )
        {
            if( ! isset($this->settings[$data]) )
            {
                throw new MissingInformationExpception(NULL, $value);  
            }
        }
    }
92285
private function hasRequestAvailable()
    {
        return (
            null !== $this->application
            && !$this->application->isClientSAPI()
            && $this->application->isStarted()
        );
    }
279964
def respond_to_missing?(method, include_private = false)
      # Short circuit if we have invalid instance variable name,
      # otherwise we get an exception that we don't need.
      return super unless valid_instance_variable? method
      if instance_variable_defined? instance_variablize(method)
        true
      else
        super
      end
    end
1101097
public function onApplicationReady()
    {
        $this->chatNotification->sendMessage("");
        $this->chatNotification->sendMessage("");
        $this->chatNotification->sendMessage('$z$fff$s       -  -   –    –     —     —    –    –   -   -');
        $this->chatNotification->sendMessage('$z$s$w$i$fff       e X p a n s i o n ²', null, []);
        $this->chatNotification->sendMessage(
            '$z$o$000                version$o '.AbstractApplication::EXPANSION_VERSION, null, []);

        $this->chatNotification->sendMessage('$z$s$fff                 —————————— ');
        $this->chatNotification->sendMessage("");
    }
425506
public function isValid(): AssertionInterface
    {
        if (!$this->proxy instanceof AutomatedInterface) {
            throw new \RuntimeException('Error, the proxy is not a valid AutomatedInterface instance');
        }

        foreach ($this->statesList as $state) {
            $this->proxy->enableState($state);
        }

        return $this;
    }
297196
public function verifyConfig()
    {
        $keys = ['implementedFinders', 'implementedMethods'];
        foreach ($keys as $key) {
            if (!isset($this->_config[$key])) {
                continue;
            }

            foreach ($this->_config[$key] as $method) {
                if (!is_callable([$this, $method])) {
                    throw new Exception(sprintf('The method %s is not callable on class %s', $method, get_class($this)));
                }
            }
        }
    }
516673
public function verifyRoute(): void
    {
        $this->context->waitUntil($this->defaultTimeout, function () {
            return false !== strpos($this->context->getSession()->getCurrentUrl(), $this->route);
        });
    }
1160653
public function send()
    {
        if (!$this->client) {
            throw new RuntimeException('A client must be set on the request');
        }

        if (null === $this->configuration->url) {
            $this->configuration->url = $this->getUrl()->toString();
        }
        $this->prepare();

        return $this->client->send($this);
    }
12776
public function process(View $view): void
    {
        if ($this->request === null) {
            throw new MissingRequestException('Cannot process a view without a request set. This method should be called from the callback passed to Pipeline::withRequest');
        }

        call_user_func($this->middleware, $view);
    }