You are here

private function YamlDumper::prepareParameters in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/dependency-injection/Dumper/YamlDumper.php \Symfony\Component\DependencyInjection\Dumper\YamlDumper::prepareParameters()

Prepares parameters.

Parameters

array $parameters:

bool $escape:

Return value

array

1 call to YamlDumper::prepareParameters()
YamlDumper::addParameters in vendor/symfony/dependency-injection/Dumper/YamlDumper.php
Adds parameters.

File

vendor/symfony/dependency-injection/Dumper/YamlDumper.php, line 307

Class

YamlDumper
YamlDumper dumps a service container as a YAML string.

Namespace

Symfony\Component\DependencyInjection\Dumper

Code

private function prepareParameters($parameters, $escape = true) {
  $filtered = array();
  foreach ($parameters as $key => $value) {
    if (is_array($value)) {
      $value = $this
        ->prepareParameters($value, $escape);
    }
    elseif ($value instanceof Reference || is_string($value) && 0 === strpos($value, '@')) {
      $value = '@' . $value;
    }
    $filtered[$key] = $value;
  }
  return $escape ? $this
    ->escape($filtered) : $filtered;
}