Code Duplication    Length = 9-9 lines in 2 locations

DependencyInjection/HttplugExtension.php 2 locations

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