Code Duplication    Length = 12-12 lines in 2 locations

Twig/Extension/EchoExtension.php 2 locations

@@ 72-83 (lines=12) @@
69
        // Query builder: remove quotes around closure
70
        // Should we really check formType or can we just
71
        // look for query_builder option?
72
        if (preg_match("/EntityType$/i", $formType)) {
73
            preg_match("/'query_builder' => '(.+?)}',/i", $options, $matches);
74
75
            if (count($matches) > 0) {
76
              $options = str_replace("'query_builder' => '$matches[1]}'", "'query_builder' => ".stripslashes($matches[1]).'}', $options);
77
            }
78
            preg_match("/'query_builder' => '(.+?)',/i", $options, $matches);
79
80
            if (count($matches) > 0) {
81
                $options = str_replace("'query_builder' => '$matches[1]'", "'query_builder' => ".stripslashes($matches[1]), $options);
82
            }
83
        }
84
85
        // Same question here
86
        if (preg_match("/ModelType$/i", $formType)) {
@@ 86-97 (lines=12) @@
83
        }
84
85
        // Same question here
86
        if (preg_match("/ModelType$/i", $formType)) {
87
            preg_match("/'query' => '(.+?)}',/i", $options, $matches);
88
89
            if (count($matches) > 0) {
90
                $options = str_replace("'query' => '$matches[1]}'", "'query' => ".stripslashes($matches[1]).'}', $options);
91
            }
92
            preg_match("/'query' => '(.+?)',/i", $options, $matches);
93
94
            if (count($matches) > 0) {
95
                $options = str_replace("'query' => '$matches[1]'", "'query' => ".stripslashes($matches[1]), $options);
96
            }
97
        }
98
99
        return $options;
100
    }