Code Duplication    Length = 6-8 lines in 2 locations

lib/Ajde/Embed.php 2 locations

@@ 31-36 (lines=6) @@
28
        foreach (self::$_detect as $provider => $test) {
29
            if (is_array($test)) {
30
                foreach ($test as $testPart) {
31
                    if (substr_count($code, $testPart) > 0) {
32
                        $providerClass = 'Ajde_Embed_'.ucfirst($provider);
33
                        if (class_exists($providerClass)) {
34
                            $embedClass = $providerClass;
35
                        }
36
                    }
37
                }
38
            } else {
39
                if (substr_count($code, $test) > 0) {
@@ 38-45 (lines=8) @@
35
                        }
36
                    }
37
                }
38
            } else {
39
                if (substr_count($code, $test) > 0) {
40
                    $providerClass = 'Ajde_Embed_'.ucfirst($provider);
41
                    if (class_exists($providerClass)) {
42
                        $embedClass = $providerClass;
43
                    }
44
                }
45
            }
46
        }
47
48
        return new $embedClass($code);