src/EndpointDiscovery/ConfigurationProvider.php
public static function env($cacheLimit = self::DEFAULT_CACHE_LIMIT)
    {
        return function () use ($cacheLimit) {
            // Use config from environment variables, if available
            $enabled = getenv(self::ENV_ENABLED);
            if ($enabled === false || $enabled === '') {
                $enabled = getenv(self::ENV_ENABLED_ALT);
            }
            if ($enabled !== false && $enabled !== '') {
                return Promise\promise_for(
                    new Configuration($enabled, $cacheLimit)
                );
            }

            return self::reject('Could not find environment variable config'
                . ' in ' . self::ENV_ENABLED);
        };
    }
public static function env($cacheLimit = self::DEFAULT_CACHE_LIMIT)
    {
        return function () use ($cacheLimit) {
            // Use config from environment variables, if available
            $enabled = getenv(self::ENV_ENABLED);
            if ($enabled === false || $enabled === '') {
                $enabled = getenv(self::ENV_ENABLED_ALT);
            }
            if ($enabled !== false && $enabled !== '') {
                return Promise\promise_for(
                    new Configuration($enabled, $cacheLimit)
                );
            }

            return self::reject('Could not find environment variable config'
                . ' in ' . self::ENV_ENABLED);
        };
    }
public static function env ( $ cacheLimit = self :: DEFAULT_CACHE_LIMIT ) { return function ( ) use ( $ cacheLimit ) { // Use config from environment variables, if available $ enabled = getenv ( self :: ENV_ENABLED ) ; if ( $ enabled === false || $ enabled === '' ) { $ enabled = getenv ( self :: ENV_ENABLED_ALT ) ; } if ( $ enabled !== false && $ enabled !== '' ) { return Promise \ promise_for ( new Configuration ( $ enabled , $ cacheLimit ) ) ; } return self :: reject ( 'Could not find environment variable config' . ' in ' . self :: ENV_ENABLED ) ; } ; }
Provider that creates config from environment variables.

@param $cacheLimit
@return callable
Provider that creates config from environment variables .