[TASK] Replace usage of $GLOBALS for correct type hinting