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