The special autoloading necessary to initialize Swiftmailer internals is incompatible with "inline_class_loader" optimization of the DIC dumper, as it bypasses the autoloading at runtime (doing it at compile-time instead).
Instead of forcing disabling the optimization when using SwiftmailerBundle, this adds a compiler pass ensuring that Swift classes are never marked as being hot path services (which are the one being optimized). This compiler pass runs after the Symfony pass determining the hot path, reverting the detection for impacted services.
The special autoloading necessary to initialize Swiftmailer internals is incompatible with "inline_class_loader" optimization of the DIC dumper, as it bypasses the autoloading at runtime (doing it at compile-time instead). Instead of forcing disabling the optimization when using SwiftmailerBundle, this adds a compiler pass ensuring that Swift classes are never marked as being hot path services (which are the one being optimized). This compiler pass runs after the Symfony pass determining the hot path, reverting the detection for impacted services.