You are here

public function ParameterBag::resolveValue in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/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 vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php
Replaces parameter placeholders (%name%) by their values for all parameters.
ParameterBag::resolveString in vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php
Resolves parameters inside a string.

File

vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php, line 170

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);
}