You are here

private function YamlDumper::escape in Zircon Profile 8

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

Escapes arguments.

Parameters

array $arguments:

Return value

array

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

File

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

Class

YamlDumper
YamlDumper dumps a service container as a YAML string.

Namespace

Symfony\Component\DependencyInjection\Dumper

Code

private function escape($arguments) {
  $args = array();
  foreach ($arguments as $k => $v) {
    if (is_array($v)) {
      $args[$k] = $this
        ->escape($v);
    }
    elseif (is_string($v)) {
      $args[$k] = str_replace('%', '%%', $v);
    }
    else {
      $args[$k] = $v;
    }
  }
  return $args;
}