Behat\Testwork\ServiceContainer\Configuration\ConfigurationLoader::loadEnvironmentConfiguration PHP Method

loadEnvironmentConfiguration() protected method

Loads information from environment variable.
protected loadEnvironmentConfiguration ( ) : array
return array
    protected function loadEnvironmentConfiguration()
    {
        $configs = array();
        if (!$this->environmentVariable) {
            return $configs;
        }
        $this->debugInformation['environment_variable_name'] = $this->environmentVariable;
        if ($envConfig = getenv($this->environmentVariable)) {
            $config = @json_decode($envConfig, true);
            $this->debugInformation['environment_variable_content'] = $envConfig;
            if (!$config) {
                throw new ConfigurationLoadingException(sprintf('Environment variable `%s` should contain a valid JSON, but it is set to `%s`.', $this->environmentVariable, $envConfig));
            }
            $configs[] = $config;
        }
        return $configs;
    }