Code Duplication    Length = 9-9 lines in 2 locations

DependencyInjection/HttplugExtension.php 2 locations

@@ 140-148 (lines=9) @@
137
    private function configurePluginByName($name, Definition $definition, array $config)
138
    {
139
        switch ($name) {
140
            case 'cache':
141
                if (class_exists('Http\Client\Common\Plugin\CachePlugin')) {
142
                    $definition->setClass('Http\Client\Common\Plugin\CachePlugin');
143
                }
144
                $definition
145
                    ->replaceArgument(0, new Reference($config['cache_pool']))
146
                    ->replaceArgument(1, new Reference($config['stream_factory']))
147
                    ->replaceArgument(2, $config['config']);
148
                break;
149
            case 'cookie':
150
                $definition->replaceArgument(0, new Reference($config['cookie_jar']));
151
                break;
@@ 158-166 (lines=9) @@
155
            case 'history':
156
                $definition->replaceArgument(0, new Reference($config['journal']));
157
                break;
158
            case 'logger':
159
                if (class_exists('Http\Client\Common\Plugin\LoggerPlugin')) {
160
                    $definition->setClass('Http\Client\Common\Plugin\LoggerPlugin');
161
                }
162
                $definition->replaceArgument(0, new Reference($config['logger']));
163
                if (!empty($config['formatter'])) {
164
                    $definition->replaceArgument(1, new Reference($config['formatter']));
165
                }
166
                break;
167
            case 'redirect':
168
                $definition
169
                    ->addArgument($config['preserve_header'])