Ensure that the given environment has at least the minimal configuration options set to start and deploy this
blueprint

@param Configuration $configurable
@param string $environment
@throws ValidationFailedException
422658
public function validate( Configuration $configurable, string $environment ) {

        $projectConfigurable = new PrefixConfigurationDecorator($configurable, "project.default.");
        $environmentConfigurable = new PrefixConfigurationDecorator($configurable, "project.environments.$environment.");
        $config = new ConfigurationFallback($environmentConfigurable, $projectConfigurable);

        $this->getValidator()->validate($config, [
            'service-name' => 'required',
        ]);
	}
1070491
public function setEnvironment(string $environment): Bootstrap
    {
        Environment::validateEnvironment($environment);
        $this->environment = $environment;

        return $this;
    }
826184
public function init( Configurable $configurable, string $environment, InputInterface $input, OutputInterface $output ) {

		/**
		 * config values from the selected environment
		 */
		$environmentConfigurable = new PrefixConfigurableDecorator($configurable, "project.environments.$environment.");

		/**
		 * config values from the project `default` section
		 */
		$projectConfigurable = new PrefixConfigurableDecorator($configurable, "project.default.");

		/**
		 * config values from the selected environment
		 * If no value is set then the project `default` is checked
		 * If no value is there then the default value is returned
		 */
		$fallbackConfigurable = new ConfigurableFallback($environmentConfigurable, $projectConfigurable);

		/**
		 * Convenience service
		 * Replaces
		 *
		 *  if( $config->has($key) )  {
		 *		echo info exists already
		 * }
		 * echo info setting default value
		 * $config->set($key, $defaultValue)
		 *
		 * with
		 * $initializer->init($$fallbackConfigurable, 'key', defaultValue) - sets in default value in environment
		 * or
		 * $initializer->init($fallbackConfigurable, 'key', defaultValue, ) - sets in default value in project defaults
		 */
		$initializer = new ConfigurationInitializer($output);



		/**
		 *
		 */
		if( $this->getFlag('dev', false) ) {
			/**
			 * Provide defaults for local development environment
			 */
			$initializer->init($fallbackConfigurable, 'mount-workdir', true);
			$initializer->init($fallbackConfigurable, 'use-app-container', false);
		} else {
            $initializer->init($fallbackConfigurable, 'rancher.stack', 'Project');

            $schedulerInitializer = new SchedulerInitializer($initializer);
            $schedulerInitializer->init($fallbackConfigurable, $projectConfigurable);
        }

        /**
         * Provide defaults for rancher environments
         */
        $initializer->init($fallbackConfigurable, 'external_links', []);

        $initializer->init($fallbackConfigurable, 'docker.repository', 'repo/name', $projectConfigurable);
        $initializer->init($fallbackConfigurable, 'docker.version-prefix', '', $projectConfigurable);
        $initializer->init($fallbackConfigurable, 'service-name', 'Project', $projectConfigurable);
        $initializer->init($fallbackConfigurable, 'docker.base-image', 'php:7.0-alpine', $projectConfigurable);
        $initializer->init($fallbackConfigurable, 'environment', ["EXAMPLE" => 'value']);

        /**
         * Blueprint specific entries
         */
        $initializer->init($fallbackConfigurable, 'php', '7.0', $projectConfigurable);
//        $initializer->init($fallbackConfigurable, 'extensions', []);
        $initializer->init($fallbackConfigurable, 'add-composer', false, $projectConfigurable);
        $initializer->init($fallbackConfigurable, 'command', "-i", $projectConfigurable);

    }
165410
public function validateForm(\Illuminate\Http\Request $request, ModelConfigurationInterface $modelConfiguration = null)
    {
        if (! $this->validModelConfiguration($modelConfiguration)) {
            return;
        }

        $verifier = app('validation.presence');

        $verifier->setConnection($this->getModel()->getConnectionName());

        $validator = \Validator::make(
            $request->all(),
            $this->getValidationRules(),
            $this->getValidationMessages(),
            $this->getValidationLabels()
        );

        $validator->setPresenceVerifier($verifier);

        $this->getModelConfiguration()->fireEvent('validate', false, $this->getModel(), $validator);

        if ($validator->fails()) {
            throw new ValidationException($validator);
        }
    }
980238
static void validateConfigurations(Configuration conf) throws ValidationException {
        if (null == conf.getHandlers()) {
            Log.error(
                    "Handler should not be null, One or more handler implementation shuld be configured in the configuration",
                    ErrorGuide.getGuide(ErrorGuide.EMPTY_HANDLERS));
            throw new ValidationException("Configuration error", ValidationException.VALIDATION_LEVEL_INVALID);
        }
        if (null == conf.getLayout()) {
            Log.error("Layout should not be null, A layout implementation shuld be configured in the configuration",
                    ErrorGuide.getGuide(ErrorGuide.EMPTY_LAYOUT));
            throw new ValidationException("Configuration error", ValidationException.VALIDATION_LEVEL_INVALID);
        }

    }
457313
protected static function enrichForDecryptionProvider(
        Configuration $configuration,
        array &$baseConfiguration
    ) : void {
        if ($configuration->hasValue('sharedKey')) {
            $baseConfiguration['sharedKey'] = $configuration->getString('sharedKey', null);
        }

        if ($configuration->hasValue('new_privatekey')) {
            $baseConfiguration['privateKeys'][] = new PrivateKey(
                $configuration->getString('new_privatekey'),
                PrivateKey::NAME_NEW,
                $configuration->getString('new_privatekey_pass', null)
            );
        }

        if ($configuration->getBoolean('assertion.encryption', false)) {
            $baseConfiguration['privateKeys'][] = new PrivateKey(
                $configuration->getString('privatekey'),
                PrivateKey::NAME_DEFAULT,
                $configuration->getString('privatekey_pass', null)
            );

            if ($configuration->hasValue('encryption.blacklisted-algorithms')) {
                $baseConfiguration['blacklistedEncryptionAlgorithms'] = $configuration
                    ->getValue('encryption.blacklisted-algorithms');
            }
        }
    }
721525
private function validate_config($config)
    {
        $required_option_keys = array('access_token', 'environment');

        foreach ($required_option_keys as $required_option_key) {
            if (!isset($config[$required_option_key])) {
                throw new \Exception('Missing required option `' . $required_option_key . '`.');
            }

            if (!is_string($config[$required_option_key])) {
                throw new \Exception('Option `'. $required_option_key .'` can only be a string.');
            }
        }
    }
709797
public void setEnvironment(ConfigurableEnvironment environment) {
		this.annotatedReader.setEnvironment(environment);
		this.xmlReader.setEnvironment(environment);
		this.scanner.setEnvironment(environment);
	}
805294
protected function validateConfig( $service ){

            // Check for config file
            if( !\Config::has('googlemaps')){

                throw new \ErrorException('Unable to find config file.');
            }

            // Validate Key parameter
            if(!array_key_exists('key', config('googlemaps') ) ){

                throw new \ErrorException('Unable to find Key parameter in configuration file.');
            }


            // Validate Key parameter
            if(!array_key_exists('service', config('googlemaps') )
                    && !array_key_exists($service, config('googlemaps.service')) ){
                throw new \ErrorException('Web service must be declared in the configuration file.');
            }

            // Validate Endpoint
            $endpointCount = count(config('googlemaps.endpoint'));
            $endpointsKeyExists = array_key_exists('endpoint', config('googlemaps'));

            if($endpointsKeyExists === false || $endpointCount < 1){
                throw new \ErrorException('End point must not be empty.');
            }


    }
924979
public function validate($value, Constraint $constraint)
    {
        $value = trim($value);

        parent::validate($value, $constraint);
    }
110899
public static function validateEnvironment(string $environment)
    {
        if (!in_array($environment, self::$validEnvironments, true)) {
            $environmentsText = '"' . implode('", ', self::$validEnvironments) . '"';
            throw new \UnexpectedValueException(
                '$environment must be one of ' . $environmentsText . ', but actually was: "' . $environment . '"',
                1499112172
            );
        }
    }
998357
public static ConfigurationException invalidConfiguration(Throwable cause, String message, Object... args) {
        throw new ConfigurationException(cause, message, args);
    }
918483
public static void validateAwsConfiguration(Properties config) {
		if (config.containsKey(AWSConfigConstants.AWS_CREDENTIALS_PROVIDER)) {
			String credentialsProviderType = config.getProperty(AWSConfigConstants.AWS_CREDENTIALS_PROVIDER);

			// value specified for AWSConfigConstants.AWS_CREDENTIALS_PROVIDER needs to be recognizable
			CredentialProvider providerType;
			try {
				providerType = CredentialProvider.valueOf(credentialsProviderType);
			} catch (IllegalArgumentException e) {
				StringBuilder sb = new StringBuilder();
				for (CredentialProvider type : CredentialProvider.values()) {
					sb.append(type.toString()).append(", ");
				}
				throw new IllegalArgumentException("Invalid AWS Credential Provider Type set in config. Valid values are: " + sb.toString());
			}

			// if BASIC type is used, also check that the Access Key ID and Secret Key is supplied
			if (providerType == CredentialProvider.BASIC) {
				if (!config.containsKey(AWSConfigConstants.AWS_ACCESS_KEY_ID)
					|| !config.containsKey(AWSConfigConstants.AWS_SECRET_ACCESS_KEY)) {
					throw new IllegalArgumentException("Please set values for AWS Access Key ID ('" + AWSConfigConstants.AWS_ACCESS_KEY_ID + "') " +
						"and Secret Key ('" + AWSConfigConstants.AWS_SECRET_ACCESS_KEY + "') when using the BASIC AWS credential provider type.");
				}
			}
		}

		if (config.containsKey(AWSConfigConstants.AWS_REGION)) {
			// specified AWS Region name must be recognizable
			if (!AWSUtil.isValidRegion(config.getProperty(AWSConfigConstants.AWS_REGION))) {
				StringBuilder sb = new StringBuilder();
				for (Regions region : Regions.values()) {
					sb.append(region.getName()).append(", ");
				}
				throw new IllegalArgumentException("Invalid AWS region set in config. Valid values are: " + sb.toString());
			}
		}
	}
998077
protected function validateEnclosure(Constraint $constraint)
    {
        if (strlen($constraint->enclosure) > 2) {
            throw new ConstraintDefinitionException(sprintf('"%s" is not a valid enclosure', $constraint->enclosure));
        }
    }
1156186
private static function validateEnvironment(string $specifiedEnvironment): void
    {
        if ('' === $specifiedEnvironment ||
            false === \in_array($specifiedEnvironment, self::LIST, true)
        ) {
            throw new \LogicException(
                \sprintf(
                    'Provided incorrect value of the environment: "%s". Allowable values: %s',
                    $specifiedEnvironment,
                    \implode(', ', \array_values(self::LIST))
                )
            );
        }
    }
130846
@Override
    public Configuration<?> configure() throws IOException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "configure");
        }

        Configuration<?> configuration = null;
        Class<? extends ValidationProvider<?>> clazz = this.getDefaultProviderClass();
        if (clazz == null) {
            // get configuration object from default provider.
            configuration = Validation.byDefaultProvider().configure();

        } else {
            @SuppressWarnings("unchecked")
            ProviderSpecificBootstrap<?> providerBootstrap = Validation.byProvider((Class) clazz);
            configuration = providerBootstrap.configure();
        }

        setMessageInterpolator(configuration);
        setTraversableResolver(configuration);
        setConstraintValidatorFactory(configuration);
        setConstraintMappings(configuration);
        setProperties(configuration);

        // Indicate to the provider configuration that xml should be ignored. We do this
        // because we need to find the correct xml's for each module, as the provider doesn't
        // guarantee this in an EE environment.
        configuration.ignoreXmlConfiguration();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "configure", configuration);
        }

        return configuration;
    }
102862
protected function getValidationConfiguration(Field $field, $validationName, Validation $validatorConfiguration)
    {
        $acceptsEmptyValues = ValidatorService::get()->validatorAcceptsEmptyValues($validatorConfiguration->getClassName());

        /** @var FormzLocalizationJavaScriptAssetHandler $formzLocalizationJavaScriptAssetHandler */
        $formzLocalizationJavaScriptAssetHandler = $this->assetHandlerFactory->getAssetHandler(FormzLocalizationJavaScriptAssetHandler::class);

        $messages = $formzLocalizationJavaScriptAssetHandler->getTranslationKeysForFieldValidation($field, $validationName);

        return ArrayService::get()->arrayToJavaScriptJson([
            'options'            => $validatorConfiguration->getOptions(),
            'messages'           => $messages,
            'settings'           => $validatorConfiguration->toArray(),
            'acceptsEmptyValues' => $acceptsEmptyValues
        ]);
    }