Code Duplication    Length = 15-16 lines in 2 locations

lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php 1 location

@@ 148-162 (lines=15) @@
145
   * @return array
146
   *   An array of prepared parameters.
147
   */
148
  protected function prepareParameters(array $parameters, $escape = TRUE) {
149
    $filtered = array();
150
    foreach ($parameters as $key => $value) {
151
      if (is_array($value)) {
152
        $value = $this->prepareParameters($value, $escape);
153
      }
154
      elseif ($value instanceof Reference) {
155
        $value = $this->dumpValue($value);
156
      }
157
158
      $filtered[$key] = $value;
159
    }
160
161
    return $escape ? $this->escape($filtered) : $filtered;
162
  }
163
164
  /**
165
   * Escapes parameters.

lib/Drupal/Core/DependencyInjection/Dumper/PhpArrayDumper.php 1 location

@@ 98-113 (lines=16) @@
95
   *
96
   * @return array
97
   */
98
  protected function prepareParameters($parameters, $escape = true)
99
  {
100
    $filtered = array();
101
    foreach ($parameters as $key => $value) {
102
      if (is_array($value)) {
103
        $value = $this->prepareParameters($value, $escape);
104
      }
105
      elseif ($value instanceof Reference) {
106
        $value = '@'.$value;
107
      }
108
109
      $filtered[$key] = $value;
110
    }
111
112
    return $escape ? $this->escape($filtered) : $filtered;
113
  }
114
115
  /**
116
   * Escapes arguments.