How to get a list of all classes implementing a specific interface (not managed by Neos/Flow)?

Hi,

I would like to get a list of all classes which implements a specific interface. As far as I understand with Flow’s Object management container and the ReflectionService this would be possible with the “getAllImplementationClassNamesForInterface” method.

But what about classes which are not managed by Neos/Flow? Is there a recommended Neos/Flow approach? Or do you just use simple native PHP Reflection?

The use case:

It is in the context of the Neos SymfonyMailer package.

For the following feature/issue:

I think about collecting all available Mailer TransportFactory classes which implement the needed interface “TransportFactoryInterface”. This then can be used to automatically create a corresponding MailerService which is aware of all mailer transport implementations.

But maybe this is just too much, and we should go for some more “static” approach like having a separate list in Neos for other 3rd Party Mailer transport implementations.

Thanks for your inputs or thoughts.