refactor: Use IVariableModel instead of VariableModel. (#8400)

* refactor: Use IVariableModel methods instead of directly accessing properties.

* refactor: replace references to VariableModel with IVariableModel.
This commit is contained in:
Aaron Dodson
2024-07-19 14:58:04 -07:00
committed by GitHub
parent 02e64bebbe
commit 294ef74d1b
22 changed files with 248 additions and 141 deletions

View File

@@ -25,7 +25,7 @@ export function procedures_defreturn(block: Block, generator: PhpGenerator) {
const workspace = block.workspace;
const usedVariables = Variables.allUsedVarModels(workspace) || [];
for (const variable of usedVariables) {
const varName = variable.name;
const varName = variable.getName();
// getVars returns parameter names, not ids, for procedure blocks
if (!block.getVars().includes(varName)) {
globals.push(generator.getVariableName(varName));