Code Duplication    Length = 12-12 lines in 2 locations

lib/Dwoo/Compiler.php 2 locations

@@ 2038-2049 (lines=12) @@
2035
            if ($pluginType & Core::COMPILABLE_PLUGIN) {
2036
                if ($pluginType & Core::CUSTOM_PLUGIN) {
2037
                    $callback = $this->customPlugins[$func]['callback'];
2038
                    if (!is_array($callback)) {
2039
                        if (!method_exists($callback, 'compile')) {
2040
                            throw new Exception('Custom plugin ' . $func . ' must implement the "compile" method to be compilable, or you should provide a full callback to the method to use');
2041
                        }
2042
                        if (($ref = new ReflectionMethod($callback, 'compile')) && $ref->isStatic()) {
2043
                            $funcCompiler = array($callback, 'compile');
2044
                        } else {
2045
                            $funcCompiler = array(new $callback(), 'compile');
2046
                        }
2047
                    } else {
2048
                        $funcCompiler = $callback;
2049
                    }
2050
                } else {
2051
                    if (class_exists('Plugin' . Core::toCamelCase($func)) !== false) {
2052
                        $funcCompiler = array('Plugin' . Core::toCamelCase($func), 'compile');
@@ 3288-3299 (lines=12) @@
3285
                        }
3286
                        if ($pluginType & Core::CUSTOM_PLUGIN) {
3287
                            $callback = $this->customPlugins[$func]['callback'];
3288
                            if (!is_array($callback)) {
3289
                                if (!method_exists($callback, 'compile')) {
3290
                                    throw new Exception('Custom plugin ' . $func . ' must implement the "compile" method to be compilable, or you should provide a full callback to the method to use');
3291
                                }
3292
                                if (($ref = new ReflectionMethod($callback, 'compile')) && $ref->isStatic()) {
3293
                                    $funcCompiler = array($callback, 'compile');
3294
                                } else {
3295
                                    $funcCompiler = array(new $callback(), 'compile');
3296
                                }
3297
                            } else {
3298
                                $funcCompiler = $callback;
3299
                            }
3300
                        } else {
3301
                            if (class_exists('Plugin' . Core::toCamelCase($func)) !== false) {
3302
                                $funcCompiler = array('Plugin' . Core::toCamelCase($func), 'compile');