I used to have a nice setup using codesniffer and psalm using flymake, but for *reasons*, I stopped using it. And I used to have lsp-mode with psalm's language server.
But bitrot has taken over so when I worked on restoring it recently I ran into some frustrations.
Anyway, I'm gonna try your set up. It seems like it should be possible to start the indexing from the command line.