You are here

public function ParameterBag::unescapeValue 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::unescapeValue()

Unescape parameter placeholders %.

Parameters

mixed $value:

Return value

mixed

Overrides ParameterBagInterface::unescapeValue

1 call to ParameterBag::unescapeValue()
ParameterBag::resolve in vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php
Replaces parameter placeholders (%name%) by their values for all parameters.

File

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

Class

ParameterBag
Holds parameters.

Namespace

Symfony\Component\DependencyInjection\ParameterBag

Code

public function unescapeValue($value) {
  if (is_string($value)) {
    return str_replace('%%', '%', $value);
  }
  if (is_array($value)) {
    $result = array();
    foreach ($value as $k => $v) {
      $result[$k] = $this
        ->unescapeValue($v);
    }
    return $result;
  }
  return $value;
}