When reviewing https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/481998/ I asked me, why the codesniffer does not found this issue.
I have debugged codesniffer and the lbFactory in $this->lbFactory was detected as T_STRING. The compare against the class name is case-insensitive and thus the sniff thinks this was used.
The fix is to ignore property assignment in the sniff