You are here

public function ParameterBag::resolve in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php \Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolve()

Replaces parameter placeholders (%name%) by their values for all parameters.

Overrides ParameterBagInterface::resolve

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php, line 154

Class

ParameterBag
Holds parameters.

Namespace

Symfony\Component\DependencyInjection\ParameterBag

Code

public function resolve() {
  if ($this->resolved) {
    return;
  }
  $parameters = array();
  foreach ($this->parameters as $key => $value) {
    try {
      $value = $this
        ->resolveValue($value);
      $parameters[$key] = $this
        ->unescapeValue($value);
    } catch (ParameterNotFoundException $e) {
      $e
        ->setSourceKey($key);
      throw $e;
    }
  }
  $this->parameters = $parameters;
  $this->resolved = true;
}