aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/UserBundle/Mailer
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-01-17 12:52:30 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-01-17 12:56:04 +0100
commite678c4752a35b06c0a77d17fc23aa2de6abc4e18 (patch)
tree0a3ef880443999636585dd17ff1f6147541b44ff /src/Wallabag/UserBundle/Mailer
parent3bcc4d4cb29abeedb48b1f297f1a65a02998ff69 (diff)
downloadwallabag-e678c4752a35b06c0a77d17fc23aa2de6abc4e18.tar.gz
wallabag-e678c4752a35b06c0a77d17fc23aa2de6abc4e18.tar.zst
wallabag-e678c4752a35b06c0a77d17fc23aa2de6abc4e18.zip
Use translator interface instead of final class
Symfony use a different class when in dev mode and prod mode. Prod loads `Symfony\Bundle\FrameworkBundle\Translation\Translator`. Dev loads `Symfony\Component\Translation\DataCollectorTranslator` to gather information for the debug bar. Fix #1585
Diffstat (limited to 'src/Wallabag/UserBundle/Mailer')
-rw-r--r--src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
index f1960070..be370e71 100644
--- a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
+++ b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
@@ -4,7 +4,7 @@ namespace Wallabag\UserBundle\Mailer;
4 4
5use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; 5use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface;
6use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface; 6use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface;
7use Symfony\Component\Translation\DataCollectorTranslator; 7use Symfony\Component\Translation\TranslatorInterface;
8 8
9/** 9/**
10 * Custom mailer for TwoFactorBundle email. 10 * Custom mailer for TwoFactorBundle email.
@@ -22,7 +22,7 @@ class AuthCodeMailer implements AuthCodeMailerInterface
22 /** 22 /**
23 * Translator for email content. 23 * Translator for email content.
24 * 24 *
25 * @var DataCollectorTranslator 25 * @var TranslatorInterface
26 */ 26 */
27 private $translator; 27 private $translator;
28 28
@@ -50,13 +50,13 @@ class AuthCodeMailer implements AuthCodeMailerInterface
50 /** 50 /**
51 * Initialize the auth code mailer with the SwiftMailer object. 51 * Initialize the auth code mailer with the SwiftMailer object.
52 * 52 *
53 * @param \Swift_Mailer $mailer 53 * @param \Swift_Mailer $mailer
54 * @param DataCollectorTranslator $translator 54 * @param TranslatorInterface $translator
55 * @param string $senderEmail 55 * @param string $senderEmail
56 * @param string $senderName 56 * @param string $senderName
57 * @param string $supportUrl 57 * @param string $supportUrl
58 */ 58 */
59 public function __construct(\Swift_Mailer $mailer, DataCollectorTranslator $translator, $senderEmail, $senderName, $supportUrl) 59 public function __construct(\Swift_Mailer $mailer, TranslatorInterface $translator, $senderEmail, $senderName, $supportUrl)
60 { 60 {
61 $this->mailer = $mailer; 61 $this->mailer = $mailer;
62 $this->translator = $translator; 62 $this->translator = $translator;