Code Duplication    Length = 16-17 lines in 2 locations

src/PhpQuery.php 2 locations

@@ 684-700 (lines=17) @@
681
            $loop      = isset($vars['PhpQueryMethods'])
682
            && !is_null($vars['PhpQueryMethods']) ? $vars['PhpQueryMethods']
683
                : get_class_methods($realClass);
684
            foreach ($loop as $method) {
685
                if ($method == '__initialize')
686
                    continue;
687
                if (!is_callable(
688
                    array(
689
                        $realClass,
690
                        $method
691
                    )
692
                )
693
                )
694
                    continue;
695
                if (isset(self::$pluginsStaticMethods[$method])) {
696
                    throw new \Exception("Duplicate method '{$method}' from plugin '{$c}' conflicts with same method from plugin '"
697
                                         . self::$pluginsStaticMethods[$method] . "'");
698
                }
699
                self::$pluginsStaticMethods[$method] = $class;
700
            }
701
            if (method_exists($realClass, '__initialize'))
702
                call_user_func_array(
703
                    array(
@@ 717-732 (lines=16) @@
714
            $loop      = isset($vars['PhpQueryMethods'])
715
            && !is_null($vars['PhpQueryMethods']) ? $vars['PhpQueryMethods']
716
                : get_class_methods($realClass);
717
            foreach ($loop as $method) {
718
                if (!is_callable(
719
                    array(
720
                        $realClass,
721
                        $method
722
                    )
723
                )
724
                )
725
                    continue;
726
                if (isset(self::$pluginsMethods[$method])) {
727
                    throw new \Exception("Duplicate method '{$method}' from plugin '{$class}' conflicts with same method from plugin '"
728
                                         . self::$pluginsMethods[$method] . "'");
729
                    continue;
730
                }
731
                self::$pluginsMethods[$method] = $class;
732
            }
733
        }
734
        return true;
735
    }