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!
use PHPePub\Core\EPub;
use PHPePub\Core\Structure\OPF\DublinCore;
use Symfony\Component\HttpFoundation\Response;
use PHPePub\Core\EPub;
use PHPePub\Core\Structure\OPF\DublinCore;
use Symfony\Component\HttpFoundation\Response;
-use Craue\ConfigBundle\Util\Config;
/**
* This class doesn't have unit test BUT it's fully covered by a functional test with ExportControllerTest.
/**
* This class doesn't have unit test BUT it's fully covered by a functional test with ExportControllerTest.
- * @param Config $craueConfig CraueConfig instance to get wallabag instance url from database
+ * @param string $wallabagUrl Wallabag instance url
* @param string $logoPath Path to the logo FROM THE BUNDLE SCOPE
*/
* @param string $logoPath Path to the logo FROM THE BUNDLE SCOPE
*/
- public function __construct(Config $craueConfig, $logoPath)
+ public function __construct($wallabagUrl, $logoPath)
- $this->wallabagUrl = $craueConfig->get('wallabag_url');
+ $this->wallabagUrl = $wallabagUrl;
$this->logoPath = $logoPath;
}
$this->logoPath = $logoPath;
}
wallabag_core.helper.entries_export:
class: Wallabag\CoreBundle\Helper\EntriesExport
arguments:
wallabag_core.helper.entries_export:
class: Wallabag\CoreBundle\Helper\EntriesExport
arguments:
+ - '@=service(''craue_config'').get(''wallabag_url'')'
- src/Wallabag/CoreBundle/Resources/public/themes/_global/img/appicon/apple-touch-icon-152.png
wallabag.operator.array.matches:
- src/Wallabag/CoreBundle/Resources/public/themes/_global/img/appicon/apple-touch-icon-152.png
wallabag.operator.array.matches:
arguments:
- "@doctrine.orm.entity_manager"
- "@wallabag_core.content_proxy"
arguments:
- "@doctrine.orm.entity_manager"
- "@wallabag_core.content_proxy"
calls:
- [ setClient, [ "@wallabag_import.pocket.client" ] ]
- [ setLogger, [ "@logger" ]]
calls:
- [ setClient, [ "@wallabag_import.pocket.client" ] ]
- [ setLogger, [ "@logger" ]]
use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface;
use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface;
use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface;
use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface;
-use Craue\ConfigBundle\Util\Config;
/**
* Custom mailer for TwoFactorBundle email.
/**
* Custom mailer for TwoFactorBundle email.
* @param \Twig_Environment $twig
* @param string $senderEmail
* @param string $senderName
* @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->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;
- "@twig"
- "%scheb_two_factor.email.sender_email%"
- "%scheb_two_factor.email.sender_name%"
- "@twig"
- "%scheb_two_factor.email.sender_email%"
- "%scheb_two_factor.email.sender_name%"
+ - '@=service(''craue_config'').get(''wallabag_support_url'')'
+ - '@=service(''craue_config'').get(''wallabag_url'')'
wallabag_user.password_resetting:
class: Wallabag\UserBundle\EventListener\PasswordResettingListener
wallabag_user.password_resetting:
class: Wallabag\UserBundle\EventListener\PasswordResettingListener