I'm porting over some Drupal 7 code to 8 and am stuck with one thing. In D7, I built some custom modules with a special hook function that would provide some debug information. To get a list of them, I can call module_implements('debugInfo'). For D8, I want to search, starting in the modules/custom directory, and return a list of modules with a class that has a public member function named 'debugInfo'. Is there a way to do this? I found an example, the first answer at PHP - get all class names inside a particular namespace, but if I have a base class with the method I'm looking for, it also reports all child classes inheriting the base class.
Since I'm only concerned with my custom modules, I can't use composer to do this. What I want is a way to get a dictionary of implemented classes from a starting directory, and get a list of available methods from the classes.