Code Duplication    Length = 9-10 lines in 3 locations

Bundle/MediaBundle/Helper/RemoteVideo/RemoteVideoHandler.php 3 locations

@@ 239-248 (lines=10) @@
236
            $parsedUrl = parse_url($data);
237
            switch ($parsedUrl['host']) {
238
                case 'www.youtube.com':
239
                case 'youtube.com':
240
                    parse_str($parsedUrl['query'], $queryFields);
241
                    $code = $queryFields['v'];
242
                    $result = new Media();
243
                    $video = new RemoteVideoHelper($result);
244
                    $video->setType('youtube');
245
                    $video->setCode($code);
246
                    $result = $video->getMedia();
247
                    $result->setName('Youtube '.$code);
248
                    break;
249
                case 'www.vimeo.com':
250
                case 'vimeo.com':
251
                    $code = substr($parsedUrl['path'], 1);
@@ 250-258 (lines=9) @@
247
                    $result->setName('Youtube '.$code);
248
                    break;
249
                case 'www.vimeo.com':
250
                case 'vimeo.com':
251
                    $code = substr($parsedUrl['path'], 1);
252
                    $result = new Media();
253
                    $video = new RemoteVideoHelper($result);
254
                    $video->setType('vimeo');
255
                    $video->setCode($code);
256
                    $result = $video->getMedia();
257
                    $result->setName('Vimeo '.$code);
258
                    break;
259
                case 'www.dailymotion.com':
260
                case 'dailymotion.com':
261
                    $code = substr($parsedUrl['path'], 7);
@@ 260-268 (lines=9) @@
257
                    $result->setName('Vimeo '.$code);
258
                    break;
259
                case 'www.dailymotion.com':
260
                case 'dailymotion.com':
261
                    $code = substr($parsedUrl['path'], 7);
262
                    $result = new Media();
263
                    $video = new RemoteVideoHelper($result);
264
                    $video->setType('dailymotion');
265
                    $video->setCode($code);
266
                    $result = $video->getMedia();
267
                    $result->setName('Dailymotion '.$code);
268
                    break;
269
            }
270
        }
271