Replace "new SettingsController()" with fetch from DI container

[MAILPOET-2436]
This commit is contained in:
Jan Jakeš
2019-10-24 10:48:58 +02:00
committed by Jack Kitterhing
parent c91cd1255a
commit d970dda637
79 changed files with 132 additions and 125 deletions

View File

@ -40,7 +40,7 @@ class Links {
static function getUnsubscribeUrl($queue, $subscriber_id) {
$subscriber = Subscriber::where('id', $subscriber_id)->findOne();
$settings = new SettingsController();
$settings = SettingsController::getInstance();
if ((boolean)$settings->get('tracking.enabled')) {
$link_hash = NewsletterLinkModel::where('queue_id', $queue->id)
->where('url', NewsletterLinkModel::UNSUBSCRIBE_LINK_SHORT_CODE)

View File

@ -38,7 +38,7 @@ class Newsletter {
private $emoji;
function __construct(WPFunctions $wp = null, PostsTask $posts_task = null, GATracking $ga_tracking = null, Emoji $emoji = null) {
$settings = new SettingsController();
$settings = SettingsController::getInstance();
$this->tracking_enabled = (boolean)$settings->get('tracking.enabled');
if ($wp === null) {
$wp = new WPFunctions;