EnvVarProcessorInterface.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\DependencyInjection;
  11. use Symfony\Component\DependencyInjection\Exception\RuntimeException;
  12. /**
  13. * The EnvVarProcessorInterface is implemented by objects that manage environment-like variables.
  14. *
  15. * @author Nicolas Grekas <p@tchwork.com>
  16. */
  17. interface EnvVarProcessorInterface
  18. {
  19. /**
  20. * Returns the value of the given variable as managed by the current instance.
  21. *
  22. * @param string $prefix The namespace of the variable
  23. * @param string $name The name of the variable within the namespace
  24. * @param \Closure $getEnv A closure that allows fetching more env vars
  25. *
  26. * @return mixed
  27. *
  28. * @throws RuntimeException on error
  29. */
  30. public function getEnv(string $prefix, string $name, \Closure $getEnv);
  31. /**
  32. * @return string[] The PHP-types managed by getEnv(), keyed by prefixes
  33. */
  34. public static function getProvidedTypes();
  35. }