Code Duplication    Length = 12-14 lines in 2 locations

src/RunOpenCode/Bundle/ExchangeRate/DependencyInjection/Extension.php 2 locations

@@ 238-249 (lines=12) @@
235
     * @param ContainerBuilder $container Service container.
236
     * @return Extension $this Fluent interface.
237
     */
238
    protected function configureSourceType(array $config, ContainerBuilder $container)
239
    {
240
        $defaults = array_merge($config['form_types']['source_type'], array('choices' => array()));
241
242
        foreach ($config['rates'] as $rate) {
243
            $defaults['choices'][sprintf('exchange_rate.source.%s', $rate['source'])] = $rate['source'];
244
        }
245
246
        $container->setParameter('run_open_code.exchange_rate.form_type.source_type', $defaults);
247
248
        return $this;
249
    }
250
251
    /**
252
     * Configure "RunOpenCode\\Bundle\\ExchangeRate\\Form\\Type\\RateTypeType" default settings.
@@ 304-317 (lines=14) @@
301
     * @param ContainerBuilder $container Service container.
302
     * @return Extension $this Fluent interface.
303
     */
304
    protected function configureForeignCurrencyCodeType(array $config, ContainerBuilder $container)
305
    {
306
        $defaults = array_merge($config['form_types']['currency_code_type'], array('choices' => array()));
307
308
        foreach ($config['rates'] as $rate) {
309
            $defaults['choices'][$rate['currency_code']] = $rate['currency_code'];
310
        }
311
312
        asort($defaults['choices']);
313
314
        $container->setParameter('run_open_code.exchange_rate.form_type.foreign_currency_code_type', $defaults);
315
316
        return $this;
317
    }
318
319
    /**
320
     * Configure "RunOpenCode\\Bundle\\ExchangeRate\\Form\\Type\\RateType" default settings.