Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EnvPlaceholderParameterBag.php

function EnvPlaceholderParameterBag::resolve

Overrides ParameterBag::resolve

File

vendor/symfony/dependency-injection/ParameterBag/EnvPlaceholderParameterBag.php, line 135

Class

EnvPlaceholderParameterBag
@author Nicolas Grekas <p@tchwork.com>

Namespace

Symfony\Component\DependencyInjection\ParameterBag

Code

public function resolve() : void {
    if ($this->resolved) {
        return;
    }
    parent::resolve();
    foreach ($this->envPlaceholders as $env => $placeholders) {
        if ($this->has($name = "env({$env})") && null !== ($default = $this->parameters[$name]) && !\is_string($default)) {
            throw new RuntimeException(\sprintf('The default value of env parameter "%s" must be a string or null, "%s" given.', $env, get_debug_type($default)));
        }
    }
}
RSS feed
Powered by Drupal