Code Duplication    Length = 15-15 lines in 2 locations

src/Rules/DependOn.php 1 location

@@ 49-63 (lines=15) @@
46
                        );
47
                }
48
            }
49
            elseif($node instanceof N\Expr\FuncCall) {
50
                // Omit calls to closures, we would not be able to
51
                // analyze them anyway atm.
52
                // Omit functions in arrays, we would not be able to
53
                // analyze them anyway atm.
54
                if (!($node->name instanceof N\Expr\Variable ||
55
                      $node->name instanceof N\Expr\ArrayDimFetch)) {
56
                    $ref_ids[] = $insert->get_reference
57
                        ( Variable::FUNCTION_TYPE
58
                        , $node->name->parts[0]
59
                        , $location->file_path()
60
                        , $node->getAttribute("startLine")
61
                        );
62
                }
63
            }
64
            elseif ($node instanceof N\Stmt\Global_) {
65
                foreach ($node->vars as $var) {
66
                    if (!($var instanceof N\Expr\Variable) || !is_string("$var->name")) {

src/Rules/Invoke.php 1 location

@@ 48-62 (lines=15) @@
45
                        );
46
                }
47
            }
48
            elseif($node instanceof N\Expr\FuncCall) {
49
                // Omit calls to closures, we would not be able to
50
                // analyze them anyway atm.
51
                // Omit functions in arrays, we would not be able to
52
                // analyze them anyway atm.
53
                if (!($node->name instanceof N\Expr\Variable ||
54
                      $node->name instanceof N\Expr\ArrayDimFetch)) {
55
                    $ref_id = $insert->get_reference
56
                        ( Variable::FUNCTION_TYPE
57
                        , $node->name->parts[0]
58
                        , $location->file_path()
59
                        , $node->getAttribute("startLine")
60
                        );
61
                }
62
            }
63
            if ($ref_id !== null) {
64
                // We need to record a invocation in every invoking entity now.
65
                $start_line = $node->getAttribute("startLine");