Validates to make sure all required services are defined
@return void
@throws \Exception
2067
private function validateServicesDefined() {
        if(!$this->getDi()->has(AclInterface::DI_NAME)) {
            throw new \Exception('Service ' . AclInterface::class . '::DI_NAME must be defined with a type of: ' . AclInterface::class);
        }
        if(!$this->getDi()->has(OutputInterface::DI_NAME)) {
            throw new \Exception('Service ' . OutputInterface::class . '::DI_NAME must be defined with a type of: ' . OutputInterface::class);
        }
    }
630815
public function validate()
	{
		try
		{
			Yaml\Yaml::parse($this->data);

		} catch(\Exception $e)
		{
			return false;
		}

		return true;
	}
1126171
protected function doValidate()
    {
        // Scan all directories mentioned and validate the class map against the entries.
        foreach ($this->information as $path) {
            $subPath  = $this->prependPathWithBaseDir($path);
            $classMap = $this->classMapFromPath($subPath);

            if (empty($classMap)) {
                $this->report->error(new NoClassesFoundInPathViolation($this->getName(), $path));
            }
        }
    }
787883
protected function checkRequirements()
    {
        parent::checkRequirements();

        // verify there is at least one item added
        if (empty($this->items) || $this->items->count() === 0) {
            throw new \Genesis\Exceptions\ErrorParameter('Empty (null) required parameter: items');
        }
    }
732886
public function main()
    {
        $this->validate();

        $codeDeploy = $this->getService();

        $config = [
            'applicationName' => $this->getApplication(),
            'currentDeploymentGroupName' => $this->getName(),
            'serviceRoleArn' => $this->getServiceRole()
        ];
        
        if ($this->autoScalingGroups) {
            $config['autoScalingGroups'] = $this->getAutoScalingGroups();
        }
        
        if ($this->ec2TagFilters) {
            $config['ec2TagFilters'] = $this->getEc2TagFilters();
        }

        if ($this->getDeploymentConfigName()) {
            $config['deploymentConfigName'] = $this->getDeploymentConfigName();
        }

        try {
            $codeDeploy
                ->getDeploymentGroup([
                    'applicationName' => $this->getApplication(),
                    'deploymentGroupName' => $this->getName()
                ]);
            // update
            if ($this->updateOnConflict) {
                $config['currentDeploymentGroupName'] = $this->getName();
                $codeDeploy->updateDeploymentGroup($config);
                $this->log('Deployment Group [' . $this->getName() . '] successfully updated.');
            } else {
                throw new \BuildException('Deployment Group [' . $this->getName() . '] already exists!');
            }
        } catch (CodeDeployException $e) {
            switch ($e->getAwsErrorCode()) {
                case 'ApplicationDoesNotExistException':
                    $codeDeploy->createApplication([
                        'applicationName' => $config['applicationName']
                    ]);
                    $this->log('Application [' . $config['applicationName'] . '] successfully created.');
                case 'DeploymentGroupDoesNotExistException':
                    // create deployment group
                    $config['deploymentGroupName'] = $this->getName();
                    $codeDeploy->createDeploymentGroup($config);
                    $this->log('Deployment Group [' . $this->getName() . '] successfully created.');
                    break;
                default:
                    throw $e;
            }
        }
    }
187603
public function validatePrerequisites() {
        try {
            Database::updateSchema(self::SCHEMA_MIGRATION_PREFIX, self::SCHEMA_SETTING_NAME, self::SCHEMA_TARGET_VERSION);
            return true;
        }
        catch (\Exception $ex) { }
        return false;
    }
258597
public function boot()
    {
        Validator::extend('scheme', '\MDooley47\UrlValidator\Rules\Scheme@passes', Scheme::message());
        Validator::extend('user', '\MDooley47\UrlValidator\Rules\User@passes', User::message());
        Validator::extend('pass', '\MDooley47\UrlValidator\Rules\Pass@passes', Pass::message());
        Validator::extend('host', '\MDooley47\UrlValidator\Rules\Host@passes', Host::message());
        Validator::extend('subdomain', '\MDooley47\UrlValidator\Rules\Subdomain@passes', Subdomain::message());
        Validator::extend('domain', '\MDooley47\UrlValidator\Rules\Domain@passes', Domain::message());
        Validator::extend('tld', '\MDooley47\UrlValidator\Rules\Tld@passes', Tld::message());
        Validator::extend('port', '\MDooley47\UrlValidator\Rules\Port@passes', Port::message());
        Validator::extend('path', '\MDooley47\UrlValidator\Rules\Path@passes', Path::message());
        Validator::extend('query', '\MDooley47\UrlValidator\Rules\Query@passes', Query::message());
        Validator::extend('fragment', '\MDooley47\UrlValidator\Rules\Fragment@passes', Fragment::message());
    }
120414
private static function validation()
    {
        $files = ['Validator', 'ValidationResult'];
        $folder = static::$root.'Validation'.'/';

        self::call($files, $folder);

        //Initiate the validation surface
        Validator::ini();
    }
1165983
public function validate()
	{
		$varValue = $this->getPost($this->strName);

		if (!empty($varValue) && !$this->isValidOption($varValue))
		{
			$this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['invalid'], (is_array($varValue) ? implode(', ', $varValue) : $varValue)));
		}

		parent::validate();
	}
388513
protected function validate_data() {
        parent::validate_data();

        if (!isset($this->other['langcode'])) {
            throw new \coding_exception('The \'langcode\' value must be set');
        }

        $cleanedlang = clean_param($this->other['langcode'], PARAM_LANG);
        if ($cleanedlang !== $this->other['langcode']) {
            throw new \coding_exception('The \'langcode\' value must be set to a valid language code');
        }
    }
915663
protected function validate()
    {
        if (!empty($this->errors)) {
            // already validated
            return;
        }

        $this->errors = [];

        foreach ($this->rules as $field => $rules) {

            $value = $this->getValue($field);

            foreach ($this->provider->getRules($rules) as $rule) {
                if ($rule->ignoreEmpty($value) && empty($rule->hasConditions())) {
                    continue;
                }

                foreach ($rule->getConditions() as $condition) {
                    if (!$condition->isMet($this, $field, $value)) {
                        // condition is not met, skipping validation
                        continue 2;
                    }
                }

                if (!$rule->validate($this, $field, $value)) {
                    // got error, jump to next field
                    $this->errors[$field] = $rule->getMessage($field, $value);
                    break;
                }
            }
        }
    }
556285
public function validate()
    {
        if (!empty($this->required)) {
            $invalid = array_diff($this->required, array_keys($this->request->args()));
            if (!empty($invalid)) {
                foreach ($invalid as $argKey) {
                    $this->request->addResult("{$argKey} required for this request.");
                }
                throw new ActionException($this, "Required arguments " . implode(', ', $invalid) . " not specified.");
            }
        }
    }
586823
protected function validate()
    {
        $args = $this->dispatcher->getParam('args');
        if (isset($this->actions[$this->actionName])) {
            $action = $this->actions[$this->actionName];
            $action->validate($args);
        }
    }
1259244
public function validate()
	{
		$errors = array();
		foreach ($this->config->getAllTypeMaps() as $typeMap) {
			try {
				$typeMap->validate();
			} catch (\Exception $e) {
				$errors[] = $e->getMessage();
			}
		}

		if (!empty($errors)) {
			throw new ValidationException(implode("\n\n", $errors));
		}
	}
1353218
public function validate()
	{
		$sourceFiles = $this->getFileList($this->sourcePath);
		// License file is required but missing from en/, so we add it here
		$sourceFiles[] = $this->sourceLanguagePath . 'LICENSE';
		$sourceFiles = array_unique($sourceFiles);

		// Get $lang['direction'] of translation to allow additional rtl-files for rtl-translations
		$filePath = $this->originPath . '/' . $this->originLanguagePath . 'common.php';

		if ($this->safeMode)
		{
			$lang = ValidatorRunner::langParser($filePath);
		}

		else
		{
			include($filePath);
		}

		$direction = $lang['DIRECTION'];
		// Throw error, if invalid direction is used
		if (!in_array($direction, array('rtl', 'ltr')))
		{
			$this->output->addMessage(Output::FATAL, 'DIRECTION needs to be rtl or ltr');
		}

		$originFiles = $this->getFileList($this->originPath);

		$missingSubsilver2Files = $availableSubsilver2Files = array();
		$validFiles = array();
		foreach ($sourceFiles as $sourceFile)
		{
			$testOriginFile = str_replace('/' . $this->sourceIso . '/', '/' . $this->originIso . '/', $sourceFile);
			if (!in_array($testOriginFile, $originFiles))
			{
				$this->output->addMessage(Output::FATAL, 'Missing required file', $testOriginFile);
			}
			else if (substr($sourceFile, -4) != '.gif' && substr($sourceFile, -12) != 'imageset.cfg')
			{
				$validFiles[$sourceFile] = $testOriginFile;
			}
		}

		foreach ($originFiles as $origin_file)
		{
			$testSourceFile = str_replace('/' . $this->originIso . '/', '/' . $this->sourceIso . '/', $origin_file);
			if (!in_array($testSourceFile, $sourceFiles))
			{
				if (in_array($origin_file, array(
					$this->originLanguagePath . 'AUTHORS.md',
					$this->originLanguagePath . 'CHANGELOG.md',
					$this->originLanguagePath . 'README.md',
					$this->originLanguagePath . 'VERSION.md',
				)))
				{
					$this->output->addMessage(Output::NOTICE, 'Found additional file', $origin_file);
				}
				else
				{
					if (substr($origin_file, -10) === '/index.htm' || $origin_file === 'index.htm')
					{
						$level = Output::NOTICE;
					}
					else if ($this->phpbbVersion === '3.2' && strpos($origin_file, 'styles/subsilver2/') === 0)
					{
						$level = Output::FATAL;
					}
					else if (in_array(substr($origin_file, -4), array('.gif', '.png')) && $direction === 'rtl')
					{
						$level = Output::WARNING;
					}
					else if (substr($origin_file, -3) !==	'.md')
					{
						$level = Output::FATAL;
					}
					else
					{
						$level = Output::ERROR;
					}

					$this->output->addMessage($level, 'Found additional file', $origin_file);
				}

				if (substr($origin_file, -14) === '/site_logo.gif')
				{
					$this->output->addMessage(Output::FATAL, 'Found additional file', $origin_file);
				}
			}
		}

		return $validFiles;
	}
276294
protected function validateArgs()
    {
        $message = null;
        foreach ($this->getMandatoryArgs() as $arg) {
            if (!isset($this->args[$arg])) {
                $message = "Argument $arg was not present in supplied job args for job " . get_class($this);
                $this->errorLog($message);
                throw new \Exception($message);
            }
        }
        if ($this->configRequired) {
            $this->ensureConfig();
        }
    }
1193134
public function validate() : void
    {
        if (null === $this->is_valid) {
            if (null === $this->user_value && null !== $this->default_value) {
                // There is a preset value, and its not being changed
                $this->is_valid = true;
            } elseif (true == $this->user_value || 1 == $this->user_value) {
                $this->user_value = 1;
                $this->is_valid = true;
            } elseif (false == $this->user_value || 0 == $this->user_value || '' == $this->user_value) {
                $this->user_value = 0;
                $this->is_valid = true;
            } elseif (false == $this->validator) {
                // This field does not get validated
                $this->is_valid = true;
            } else {
                $this->is_valid = false;
                $this->error = 'The provided value is not valid. Please enter a valid value.';
            }
        }

        // Check if the input is different from the default value
        if ($this->is_valid && null !== $this->user_value) {
            $this->is_changed = ($this->default_value != $this->user_value);
        }
    }