mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 13:51:54 +01:00
Remove impossible TODO.
This commit is contained in:
parent
3c7d176f87
commit
bf606202f8
@ -70,11 +70,6 @@ class Context
|
||||
|
||||
/**
|
||||
* A set of globals that are referenced somewhere.
|
||||
* Ideally this shouldn't be needed and GlobalAnalyzer should add an edge to the
|
||||
* DataFlowGraph pointing from the global to its use in another scope, but since that's
|
||||
* difficult this is used as a workaround to always mark referenced globals as used.
|
||||
*
|
||||
* @internal May be removed if GlobalAnalyzer is improved.
|
||||
*
|
||||
* @var array<string, true>
|
||||
*/
|
||||
|
@ -95,15 +95,7 @@ class GlobalAnalyzer
|
||||
|
||||
if ($statements_analyzer->data_flow_graph instanceof VariableUseGraph) {
|
||||
if ($global_context !== null && $global_context->hasVariable($var_id)) {
|
||||
// TODO get global CodeLocation so that global variable can be marked as unused if it is
|
||||
// unused inside the function. Marking it as a referenced global causes it to be marked
|
||||
// used if it's used as a global in any function, even if it's unused in that function.
|
||||
$global_context->referenced_globals[$var_id] = true;
|
||||
// $statements_analyzer->data_flow_graph->addPath(
|
||||
// $assignment_node,
|
||||
// $global_node,
|
||||
// 'byref-assignment'
|
||||
// );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user