You are here

public function ParameterBag::resolveValue in Service Container 7.2

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

Replaces parameter placeholders (%name%) by their values.

Parameters

mixed $value A value:

array $resolving An array of keys that are being resolved (used internally to detect circular references):

Return value

mixed The resolved value

Throws

ParameterNotFoundException if a placeholder references a parameter that does not exist

ParameterCircularReferenceException if a circular reference if detected

RuntimeException when a given parameter has a type problem.

Overrides ParameterBagInterface::resolveValue

2 calls to ParameterBag::resolveValue()
ParameterBag::resolve in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php
Replaces parameter placeholders (%name%) by their values for all parameters.
ParameterBag::resolveString in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php
Resolves parameters inside a string.

File

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

Class

ParameterBag
Holds parameters.

Namespace

Symfony\Component\DependencyInjection\ParameterBag

Code

public function resolveValue($value, array $resolving = array()) {
  if (is_array($value)) {
    $args = array();
    foreach ($value as $k => $v) {
      $args[$this
        ->resolveValue($k, $resolving)] = $this
        ->resolveValue($v, $resolving);
    }
    return $args;
  }
  if (!is_string($value)) {
    return $value;
  }
  return $this
    ->resolveString($value, $resolving);
}