mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-26 18:21:02 +00:00
Inject parameter instead of service
We are injecting CraueConfig service when we only need to retrieve one or two values from it. Instead I discovered we can directly inject a value from a service in the service definition!
This commit is contained in:
parent
f74061f1e1
commit
4b3c983ab8
5 changed files with 11 additions and 12 deletions
|
@ -4,7 +4,6 @@ namespace Wallabag\UserBundle\Mailer;
|
|||
|
||||
use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface;
|
||||
use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface;
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
|
||||
/**
|
||||
* Custom mailer for TwoFactorBundle email.
|
||||
|
@ -61,16 +60,17 @@ class AuthCodeMailer implements AuthCodeMailerInterface
|
|||
* @param \Twig_Environment $twig
|
||||
* @param string $senderEmail
|
||||
* @param string $senderName
|
||||
* @param Config $craueConfig Craue\Config instance to get wallabag support url from database
|
||||
* @param string $supportUrl wallabag support url
|
||||
* @param string $wallabagUrl wallabag instance url
|
||||
*/
|
||||
public function __construct(\Swift_Mailer $mailer, \Twig_Environment $twig, $senderEmail, $senderName, Config $craueConfig)
|
||||
public function __construct(\Swift_Mailer $mailer, \Twig_Environment $twig, $senderEmail, $senderName, $supportUrl, $wallabagUrl)
|
||||
{
|
||||
$this->mailer = $mailer;
|
||||
$this->twig = $twig;
|
||||
$this->senderEmail = $senderEmail;
|
||||
$this->senderName = $senderName;
|
||||
$this->supportUrl = $craueConfig->get('wallabag_support_url');
|
||||
$this->wallabagUrl = $craueConfig->get('wallabag_url');
|
||||
$this->supportUrl = $supportUrl;
|
||||
$this->wallabagUrl = $wallabagUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue