Commit f409df8f authored by Jordi Boggiano's avatar Jordi Boggiano

Remove event type hint as ConsoleEvents are not ResponseEvents

parent 2183542a
...@@ -99,7 +99,8 @@ class SwiftmailerServiceProvider implements ServiceProviderInterface, EventListe ...@@ -99,7 +99,8 @@ class SwiftmailerServiceProvider implements ServiceProviderInterface, EventListe
public function subscribe(Container $app, EventDispatcherInterface $dispatcher) public function subscribe(Container $app, EventDispatcherInterface $dispatcher)
{ {
$onTerminate = function (PostResponseEvent $event) use ($app) { // Event has no typehint as it can be either a PostResponseEvent or a ConsoleTerminateEvent
$onTerminate = function ($event) use ($app) {
// To speed things up (by avoiding Swift Mailer initialization), flush // To speed things up (by avoiding Swift Mailer initialization), flush
// messages only if our mailer has been created (potentially used) // messages only if our mailer has been created (potentially used)
if ($app['mailer.initialized']) { if ($app['mailer.initialized']) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment