If a variable is used with & for pass-by-references in a function argument or a foreach loop, that is only needed when the variable is overwritten with an assignment.
If the variable is an object and only a property of the object is changed, there is no need to use &.
This could be reported by a linter, maybe codesniffer or better phan (upstream?)
If this is useful in phan, than an upstream bug should be created or maybe only a config is missing?
See https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Kartographer/+/673963 for an example patch set