Make all constructor signatures multiline

[MAILPOET-3732]
This commit is contained in:
Pavel Dohnal
2021-09-16 13:15:19 +02:00
committed by Jan Lysý
parent 150862d986
commit cdda3480ca
200 changed files with 751 additions and 200 deletions

View File

@ -10,7 +10,9 @@ class ErrorHandler {
/** @var string[] */ /** @var string[] */
private $defaultErrors; private $defaultErrors;
public function __construct(WPFunctions $wp) { public function __construct(
WPFunctions $wp
) {
$this->defaultErrors = [ $this->defaultErrors = [
Error::UNKNOWN => $wp->__('An unknown error occurred.', 'mailpoet'), Error::UNKNOWN => $wp->__('An unknown error occurred.', 'mailpoet'),
]; ];

View File

@ -7,7 +7,11 @@ use MailPoet\WP\Functions as WPFunctions;
class ErrorResponse extends Response { class ErrorResponse extends Response {
public $errors; public $errors;
public function __construct($errors = [], $meta = [], $status = self::STATUS_NOT_FOUND) { public function __construct(
$errors = [],
$meta = [],
$status = self::STATUS_NOT_FOUND
) {
parent::__construct($status, $meta); parent::__construct($status, $meta);
$this->errors = $this->formatErrors($errors); $this->errors = $this->formatErrors($errors);
} }

View File

@ -16,7 +16,10 @@ abstract class Response {
public $status; public $status;
public $meta; public $meta;
public function __construct($status, $meta = []) { public function __construct(
$status,
$meta = []
) {
$this->status = $status; $this->status = $status;
$this->meta = $meta; $this->meta = $meta;
} }

View File

@ -11,7 +11,9 @@ class FormsResponseBuilder {
/** @var StatisticsFormsRepository */ /** @var StatisticsFormsRepository */
private $statisticsFormsRepository; private $statisticsFormsRepository;
public function __construct(StatisticsFormsRepository $statisticsFormsRepository) { public function __construct(
StatisticsFormsRepository $statisticsFormsRepository
) {
$this->statisticsFormsRepository = $statisticsFormsRepository; $this->statisticsFormsRepository = $statisticsFormsRepository;
} }

View File

@ -5,7 +5,11 @@ namespace MailPoet\API\JSON;
class SuccessResponse extends Response { class SuccessResponse extends Response {
public $data; public $data;
public function __construct($data = [], $meta = [], $status = self::STATUS_OK) { public function __construct(
$data = [],
$meta = [],
$status = self::STATUS_OK
) {
parent::__construct($status, $meta); parent::__construct($status, $meta);
$this->data = $data; $this->data = $data;
} }

View File

@ -15,7 +15,9 @@ class Analytics extends APIEndpoint {
'global' => AccessControl::NO_ACCESS_RESTRICTION, 'global' => AccessControl::NO_ACCESS_RESTRICTION,
]; ];
public function __construct(Reporter $reporter) { public function __construct(
Reporter $reporter
) {
$this->reporter = $reporter; $this->reporter = $reporter;
} }

View File

@ -15,7 +15,10 @@ class AutomatedLatestContent extends APIEndpoint {
'global' => AccessControl::PERMISSION_MANAGE_EMAILS, 'global' => AccessControl::PERMISSION_MANAGE_EMAILS,
]; ];
public function __construct(\MailPoet\Newsletter\AutomatedLatestContent $alc, WPFunctions $wp) { public function __construct(
\MailPoet\Newsletter\AutomatedLatestContent $alc,
WPFunctions $wp
) {
$this->ALC = $alc; $this->ALC = $alc;
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -20,7 +20,10 @@ class FeatureFlags extends APIEndpoint {
/** @var FeatureFlagsController */ /** @var FeatureFlagsController */
private $featureFlagsController; private $featureFlagsController;
public function __construct(FeaturesController $featuresController, FeatureFlagsController $featureFlags) { public function __construct(
FeaturesController $featuresController,
FeatureFlagsController $featureFlags
) {
$this->featuresController = $featuresController; $this->featuresController = $featuresController;
$this->featureFlagsController = $featureFlags; $this->featureFlagsController = $featureFlags;
} }

View File

@ -13,7 +13,9 @@ class MP2Migrator extends APIEndpoint {
/** @var \MailPoet\Config\MP2Migrator */ /** @var \MailPoet\Config\MP2Migrator */
private $MP2Migrator; private $MP2Migrator;
public function __construct(\MailPoet\Config\MP2Migrator $MP2Migrator) { public function __construct(
\MailPoet\Config\MP2Migrator $MP2Migrator
) {
$this->MP2Migrator = $MP2Migrator; $this->MP2Migrator = $MP2Migrator;
} }

View File

@ -30,7 +30,12 @@ class Mailer extends APIEndpoint {
'global' => AccessControl::PERMISSION_MANAGE_EMAILS, 'global' => AccessControl::PERMISSION_MANAGE_EMAILS,
]; ];
public function __construct(AuthorizedEmailsController $authorizedEmailsController, SettingsController $settings, Bridge $bridge, MetaInfo $mailerMetaInfo) { public function __construct(
AuthorizedEmailsController $authorizedEmailsController,
SettingsController $settings,
Bridge $bridge,
MetaInfo $mailerMetaInfo
) {
$this->authorizedEmailsController = $authorizedEmailsController; $this->authorizedEmailsController = $authorizedEmailsController;
$this->settings = $settings; $this->settings = $settings;
$this->bridge = $bridge; $this->bridge = $bridge;

View File

@ -15,7 +15,9 @@ class NewsletterLinks extends APIEndpoint {
/** @var NewsletterLinkRepository */ /** @var NewsletterLinkRepository */
private $newsletterLinkRepository; private $newsletterLinkRepository;
public function __construct(NewsletterLinkRepository $newsletterLinkRepository) { public function __construct(
NewsletterLinkRepository $newsletterLinkRepository
) {
$this->newsletterLinkRepository = $newsletterLinkRepository; $this->newsletterLinkRepository = $newsletterLinkRepository;
} }

View File

@ -18,7 +18,10 @@ class Setup extends APIEndpoint {
/** @var Activator */ /** @var Activator */
private $activator; private $activator;
public function __construct(WPFunctions $wp, Activator $activator) { public function __construct(
WPFunctions $wp,
Activator $activator
) {
$this->wp = $wp; $this->wp = $wp;
$this->activator = $activator; $this->activator = $activator;
} }

View File

@ -17,7 +17,9 @@ class UserFlags extends APIEndpoint {
'global' => AccessControl::ALL_ROLES_ACCESS, 'global' => AccessControl::ALL_ROLES_ACCESS,
]; ];
public function __construct(UserFlagsController $userFlags) { public function __construct(
UserFlagsController $userFlags
) {
$this->userFlags = $userFlags; $this->userFlags = $userFlags;
} }

View File

@ -18,7 +18,9 @@ class WoocommerceSettings extends APIEndpoint {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(WPFunctions $wp) { public function __construct(
WPFunctions $wp
) {
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -8,7 +8,9 @@ class ExperimentalFeatures {
/** @var PageRenderer */ /** @var PageRenderer */
private $pageRenderer; private $pageRenderer;
public function __construct(PageRenderer $pageRenderer) { public function __construct(
PageRenderer $pageRenderer
) {
$this->pageRenderer = $pageRenderer; $this->pageRenderer = $pageRenderer;
} }

View File

@ -24,7 +24,12 @@ class Help {
/** @var Beacon */ /** @var Beacon */
private $helpscoutBeacon; private $helpscoutBeacon;
public function __construct(PageRenderer $pageRenderer, State $tasksState, CronHelper $cronHelper, Beacon $helpscoutBeacon) { public function __construct(
PageRenderer $pageRenderer,
State $tasksState,
CronHelper $cronHelper,
Beacon $helpscoutBeacon
) {
$this->pageRenderer = $pageRenderer; $this->pageRenderer = $pageRenderer;
$this->tasksState = $tasksState; $this->tasksState = $tasksState;
$this->cronHelper = $cronHelper; $this->cronHelper = $cronHelper;

View File

@ -12,7 +12,10 @@ class MP2Migration {
/** @var MP2Migrator */ /** @var MP2Migrator */
private $mp2Migrator; private $mp2Migrator;
public function __construct(PageRenderer $pageRenderer, MP2Migrator $mp2Migrator) { public function __construct(
PageRenderer $pageRenderer,
MP2Migrator $mp2Migrator
) {
$this->pageRenderer = $pageRenderer; $this->pageRenderer = $pageRenderer;
$this->mp2Migrator = $mp2Migrator; $this->mp2Migrator = $mp2Migrator;
} }

View File

@ -16,7 +16,11 @@ class Premium {
/** @var SubscribersFeature */ /** @var SubscribersFeature */
private $subscribersFeature; private $subscribersFeature;
public function __construct(PageRenderer $pageRenderer, WPFunctions $wp, SubscribersFeature $subscribersFeature) { public function __construct(
PageRenderer $pageRenderer,
WPFunctions $wp,
SubscribersFeature $subscribersFeature
) {
$this->pageRenderer = $pageRenderer; $this->pageRenderer = $pageRenderer;
$this->wp = $wp; $this->wp = $wp;
$this->subscribersFeature = $subscribersFeature; $this->subscribersFeature = $subscribersFeature;

View File

@ -9,7 +9,9 @@ class SubscribersExport {
/** @var PageRenderer */ /** @var PageRenderer */
private $pageRenderer; private $pageRenderer;
public function __construct(PageRenderer $pageRenderer) { public function __construct(
PageRenderer $pageRenderer
) {
$this->pageRenderer = $pageRenderer; $this->pageRenderer = $pageRenderer;
} }

View File

@ -18,7 +18,11 @@ class SubscribersImport {
/** @var Block\Date */ /** @var Block\Date */
private $dateBlock; private $dateBlock;
public function __construct(PageRenderer $pageRenderer, Installation $installation, Block\Date $dateBlock) { public function __construct(
PageRenderer $pageRenderer,
Installation $installation,
Block\Date $dateBlock
) {
$this->pageRenderer = $pageRenderer; $this->pageRenderer = $pageRenderer;
$this->installation = $installation; $this->installation = $installation;
$this->dateBlock = $dateBlock; $this->dateBlock = $dateBlock;

View File

@ -13,7 +13,10 @@ class WooCommerceSetup {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(PageRenderer $pageRenderer, WPFunctions $wp) { public function __construct(
PageRenderer $pageRenderer,
WPFunctions $wp
) {
$this->pageRenderer = $pageRenderer; $this->pageRenderer = $pageRenderer;
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -21,7 +21,10 @@ class Analytics {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(Reporter $reporter, SettingsController $settingsController) { public function __construct(
Reporter $reporter,
SettingsController $settingsController
) {
$this->reporter = $reporter; $this->reporter = $reporter;
$this->settings = $settingsController; $this->settings = $settingsController;
$this->wp = new WPFunctions; $this->wp = new WPFunctions;

View File

@ -20,7 +20,11 @@ class AbandonedCartPageVisitTracker {
/** @var Cookies */ /** @var Cookies */
private $cookies; private $cookies;
public function __construct(WPFunctions $wp, WooCommerceHelper $wooCommerceHelper, Cookies $cookies) { public function __construct(
WPFunctions $wp,
WooCommerceHelper $wooCommerceHelper,
Cookies $cookies
) {
$this->wp = $wp; $this->wp = $wp;
$this->wooCommerceHelper = $wooCommerceHelper; $this->wooCommerceHelper = $wooCommerceHelper;
$this->cookies = $cookies; $this->cookies = $cookies;

View File

@ -31,7 +31,9 @@ class FirstPurchase {
/** @var AutomaticEmailsRepository */ /** @var AutomaticEmailsRepository */
private $repository; private $repository;
public function __construct(WCHelper $helper = null) { public function __construct(
WCHelper $helper = null
) {
if ($helper === null) { if ($helper === null) {
$helper = new WCHelper(); $helper = new WCHelper();
} }

View File

@ -26,7 +26,9 @@ class PurchasedInCategory {
/** @var AutomaticEmailsRepository */ /** @var AutomaticEmailsRepository */
private $repository; private $repository;
public function __construct(WCHelper $woocommerceHelper = null) { public function __construct(
WCHelper $woocommerceHelper = null
) {
if ($woocommerceHelper === null) { if ($woocommerceHelper === null) {
$woocommerceHelper = new WCHelper(); $woocommerceHelper = new WCHelper();
} }

View File

@ -28,7 +28,9 @@ class PurchasedProduct {
/** @var AutomaticEmailsRepository */ /** @var AutomaticEmailsRepository */
private $repository; private $repository;
public function __construct(WCHelper $helper = null) { public function __construct(
WCHelper $helper = null
) {
if ($helper === null) { if ($helper === null) {
$helper = new WCHelper(); $helper = new WCHelper();
} }

View File

@ -12,7 +12,9 @@ class TransientCache {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(WPFunctions $wp) { public function __construct(
WPFunctions $wp
) {
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -19,7 +19,11 @@ class Activator {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(SettingsController $settings, Populator $populator, WPFunctions $wp) { public function __construct(
SettingsController $settings,
Populator $populator,
WPFunctions $wp
) {
$this->settings = $settings; $this->settings = $settings;
$this->populator = $populator; $this->populator = $populator;
$this->wp = $wp; $this->wp = $wp;

View File

@ -14,7 +14,10 @@ class Capabilities {
/** @var AccessControl */ /** @var AccessControl */
private $accessControl; private $accessControl;
public function __construct($renderer = null, WPFunctions $wp = null) { public function __construct(
$renderer = null,
WPFunctions $wp = null
) {
if ($renderer !== null) { if ($renderer !== null) {
$this->renderer = $renderer; $this->renderer = $renderer;
} }

View File

@ -8,7 +8,9 @@ use MailPoetVendor\Psr\Container\ContainerInterface;
class DatabaseInitializer { class DatabaseInitializer {
private $diContainer; private $diContainer;
public function __construct(ContainerInterface $diContainer) { public function __construct(
ContainerInterface $diContainer
) {
$this->diContainer = $diContainer; $this->diContainer = $diContainer;
} }

View File

@ -16,7 +16,9 @@ class Installer {
/** @var SettingsController */ /** @var SettingsController */
private $settings; private $settings;
public function __construct($slug) { public function __construct(
$slug
) {
$this->slug = $slug; $this->slug = $slug;
$this->settings = SettingsController::getInstance(); $this->settings = SettingsController::getInstance();
} }

View File

@ -42,7 +42,10 @@ class MP2Migrator {
private $mp2UserTable; private $mp2UserTable;
private $mp2UserListTable; private $mp2UserListTable;
public function __construct(SettingsController $settings, Activator $activator) { public function __construct(
SettingsController $settings,
Activator $activator
) {
$this->defineMP2Tables(); $this->defineMP2Tables();
$logFilename = 'mp2migration.log'; $logFilename = 'mp2migration.log';
$this->logFile = Env::$tempPath . '/' . $logFilename; $this->logFile = Env::$tempPath . '/' . $logFilename;

View File

@ -7,7 +7,9 @@ use MailPoet\WP\Functions as WPFunctions;
class PluginActivatedHook { class PluginActivatedHook {
private $deferredAdminNotices; private $deferredAdminNotices;
public function __construct(DeferredAdminNotices $deferredAdminNotices) { public function __construct(
DeferredAdminNotices $deferredAdminNotices
) {
$this->deferredAdminNotices = $deferredAdminNotices; $this->deferredAdminNotices = $deferredAdminNotices;
} }

View File

@ -19,7 +19,10 @@ class Renderer {
public $assetsManifestJs; public $assetsManifestJs;
public $assetsManifestCss; public $assetsManifestCss;
public function __construct($cachingEnabled = false, $debuggingEnabled = false) { public function __construct(
$cachingEnabled = false,
$debuggingEnabled = false
) {
$this->cachingEnabled = $cachingEnabled; $this->cachingEnabled = $cachingEnabled;
$this->debuggingEnabled = $debuggingEnabled; $this->debuggingEnabled = $debuggingEnabled;
$this->cachePath = Env::$cachePath; $this->cachePath = Env::$cachePath;

View File

@ -19,7 +19,9 @@ class RequirementsChecker {
'\Html2Text\Html2Text', '\Html2Text\Html2Text',
]; ];
public function __construct($displayErrorNotice = true) { public function __construct(
$displayErrorNotice = true
) {
$this->displayErrorNotice = $displayErrorNotice; $this->displayErrorNotice = $displayErrorNotice;
} }

View File

@ -8,7 +8,9 @@ class Router {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(WPFunctions $wp) { public function __construct(
WPFunctions $wp
) {
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -15,7 +15,11 @@ class Updater {
/** @var SettingsController */ /** @var SettingsController */
private $settings; private $settings;
public function __construct($pluginName, $slug, $version) { public function __construct(
$pluginName,
$slug,
$version
) {
$this->plugin = WPFunctions::get()->pluginBasename($pluginName); $this->plugin = WPFunctions::get()->pluginBasename($pluginName);
$this->slug = $slug; $this->slug = $slug;
$this->version = $version; $this->version = $version;

View File

@ -24,7 +24,10 @@ class CronHelper {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(SettingsController $settings, WPFunctions $wp) { public function __construct(
SettingsController $settings,
WPFunctions $wp
) {
$this->settings = $settings; $this->settings = $settings;
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -23,7 +23,11 @@ class CronWorkerRunner {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(CronHelper $cronHelper, CronWorkerScheduler $cronWorkerScheduler, WPFunctions $wp) { public function __construct(
CronHelper $cronHelper,
CronWorkerScheduler $cronWorkerScheduler,
WPFunctions $wp
) {
$this->timer = microtime(true); $this->timer = microtime(true);
$this->cronHelper = $cronHelper; $this->cronHelper = $cronHelper;
$this->cronWorkerScheduler = $cronWorkerScheduler; $this->cronWorkerScheduler = $cronWorkerScheduler;

View File

@ -26,7 +26,12 @@ class DaemonHttpRunner {
/** @var WordPress */ /** @var WordPress */
private $wordpressTrigger; private $wordpressTrigger;
public function __construct(Daemon $daemon = null, CronHelper $cronHelper, SettingsController $settings, WordPress $wordpressTrigger) { public function __construct(
Daemon $daemon = null,
CronHelper $cronHelper,
SettingsController $settings,
WordPress $wordpressTrigger
) {
$this->cronHelper = $cronHelper; $this->cronHelper = $cronHelper;
$this->settingsDaemonData = $this->cronHelper->getDaemon(); $this->settingsDaemonData = $this->cronHelper->getDaemon();
$this->token = $this->cronHelper->createToken(); $this->token = $this->cronHelper->createToken();

View File

@ -9,7 +9,9 @@ class Supervisor {
/** @var CronHelper */ /** @var CronHelper */
private $cronHelper; private $cronHelper;
public function __construct(CronHelper $cronHelper) { public function __construct(
CronHelper $cronHelper
) {
$this->cronHelper = $cronHelper; $this->cronHelper = $cronHelper;
} }

View File

@ -8,7 +8,9 @@ class MailPoet {
/** @var Supervisor */ /** @var Supervisor */
private $supervisor; private $supervisor;
public function __construct(Supervisor $supervisor) { public function __construct(
Supervisor $supervisor
) {
$this->supervisor = $supervisor; $this->supervisor = $supervisor;
} }

View File

@ -13,7 +13,9 @@ class AuthorizedSendingEmailsCheck extends SimpleWorker {
/** @var AuthorizedEmailsController */ /** @var AuthorizedEmailsController */
private $authorizedEmailsController; private $authorizedEmailsController;
public function __construct(AuthorizedEmailsController $authorizedEmailsController) { public function __construct(
AuthorizedEmailsController $authorizedEmailsController
) {
$this->authorizedEmailsController = $authorizedEmailsController; $this->authorizedEmailsController = $authorizedEmailsController;
parent::__construct(); parent::__construct();
} }

View File

@ -15,7 +15,10 @@ class Beamer extends SimpleWorker {
/** @var SettingsController */ /** @var SettingsController */
private $settings; private $settings;
public function __construct(SettingsController $settings, WPFunctions $wp) { public function __construct(
SettingsController $settings,
WPFunctions $wp
) {
parent::__construct($wp); parent::__construct($wp);
$this->settings = $settings; $this->settings = $settings;
} }

View File

@ -11,7 +11,9 @@ class PremiumKeyCheck extends KeyCheckWorker {
/** @var SettingsController */ /** @var SettingsController */
private $settings; private $settings;
public function __construct(SettingsController $settings) { public function __construct(
SettingsController $settings
) {
$this->settings = $settings; $this->settings = $settings;
parent::__construct(); parent::__construct();
} }

View File

@ -18,7 +18,10 @@ class SendingServiceKeyCheck extends KeyCheckWorker {
/** @var ServicesChecker */ /** @var ServicesChecker */
private $servicesChecker; private $servicesChecker;
public function __construct(SettingsController $settings, ServicesChecker $servicesChecker) { public function __construct(
SettingsController $settings,
ServicesChecker $servicesChecker
) {
$this->settings = $settings; $this->settings = $settings;
$this->servicesChecker = $servicesChecker; $this->servicesChecker = $servicesChecker;
parent::__construct(); parent::__construct();

View File

@ -10,7 +10,9 @@ class SendingErrorHandler {
/** @var SendingThrottlingHandler */ /** @var SendingThrottlingHandler */
private $throttlingHandler; private $throttlingHandler;
public function __construct(SendingThrottlingHandler $throttlingHandler) { public function __construct(
SendingThrottlingHandler $throttlingHandler
) {
$this->throttlingHandler = $throttlingHandler; $this->throttlingHandler = $throttlingHandler;
} }

View File

@ -8,7 +8,9 @@ use MailPoet\Mailer\MailerLog;
class Mailer { class Mailer {
public $mailer; public $mailer;
public function __construct($mailer = false) { public function __construct(
$mailer = false
) {
$this->mailer = ($mailer) ? $mailer : $this->configureMailer(); $this->mailer = ($mailer) ? $mailer : $this->configureMailer();
} }

View File

@ -27,7 +27,9 @@ abstract class SimpleWorker implements CronWorkerInterface {
/** @var WPFunctions */ /** @var WPFunctions */
protected $wp; protected $wp;
public function __construct(WPFunctions $wp = null) { public function __construct(
WPFunctions $wp = null
) {
if (static::TASK_TYPE === null) { if (static::TASK_TYPE === null) {
throw new \Exception('Constant TASK_TYPE is not defined on subclass ' . get_class($this)); throw new \Exception('Constant TASK_TYPE is not defined on subclass ' . get_class($this));
} }

View File

@ -17,7 +17,10 @@ class WooCommerceSync extends SimpleWorker {
/** @var WooCommerceHelper */ /** @var WooCommerceHelper */
private $woocommerceHelper; private $woocommerceHelper;
public function __construct(WooCommerceSegment $woocommerceSegment, WooCommerceHelper $woocommerceHelper) { public function __construct(
WooCommerceSegment $woocommerceSegment,
WooCommerceHelper $woocommerceHelper
) {
$this->woocommerceSegment = $woocommerceSegment; $this->woocommerceSegment = $woocommerceSegment;
$this->woocommerceHelper = $woocommerceHelper; $this->woocommerceHelper = $woocommerceHelper;
parent::__construct(); parent::__construct();

View File

@ -17,7 +17,9 @@ class WorkersFactory {
/** @var ContainerWrapper */ /** @var ContainerWrapper */
private $container; private $container;
public function __construct(ContainerWrapper $container) { public function __construct(
ContainerWrapper $container
) {
$this->container = $container; $this->container = $container;
} }

View File

@ -10,7 +10,9 @@ class ContainerFactory {
/** @var IContainerConfigurator */ /** @var IContainerConfigurator */
private $configurator; private $configurator;
public function __construct(IContainerConfigurator $configurator) { public function __construct(
IContainerConfigurator $configurator
) {
$this->configurator = $configurator; $this->configurator = $configurator;
} }

View File

@ -17,7 +17,10 @@ class ContainerWrapper implements ContainerInterface {
/** @var ContainerWrapper|null */ /** @var ContainerWrapper|null */
private static $instance; private static $instance;
public function __construct(Container $freeContainer, Container $premiumContainer = null) { public function __construct(
Container $freeContainer,
Container $premiumContainer = null
) {
$this->freeContainer = $freeContainer; $this->freeContainer = $freeContainer;
$this->premiumContainer = $premiumContainer; $this->premiumContainer = $premiumContainer;
} }

View File

@ -23,7 +23,9 @@ class DynamicSegmentFilterData {
*/ */
private $filterData; private $filterData;
public function __construct(array $filterData) { public function __construct(
array $filterData
) {
$this->filterData = $filterData; $this->filterData = $filterData;
} }

View File

@ -30,7 +30,10 @@ class DynamicSegmentFilterEntity {
*/ */
private $filterData; private $filterData;
public function __construct(SegmentEntity $segment, DynamicSegmentFilterData $filterData) { public function __construct(
SegmentEntity $segment,
DynamicSegmentFilterData $filterData
) {
$this->segment = $segment; $this->segment = $segment;
$this->filterData = $filterData; $this->filterData = $filterData;
} }

View File

@ -32,7 +32,10 @@ class FeatureFlagEntity {
* @param string $name * @param string $name
* @param bool|null $value * @param bool|null $value
*/ */
public function __construct($name, $value = null) { public function __construct(
$name,
$value = null
) {
$this->name = $name; $this->name = $name;
$this->value = $value; $this->value = $value;
} }

View File

@ -83,7 +83,9 @@ class FormEntity {
*/ */
private $styles; private $styles;
public function __construct($name) { public function __construct(
$name
) {
$this->name = $name; $this->name = $name;
$this->status = self::STATUS_ENABLED; $this->status = self::STATUS_ENABLED;
} }

View File

@ -54,7 +54,12 @@ class NewsletterLinkEntity {
*/ */
private $clicks; private $clicks;
public function __construct(NewsletterEntity $newsletter, SendingQueueEntity $queue, string $url, string $hash) { public function __construct(
NewsletterEntity $newsletter,
SendingQueueEntity $queue,
string $url,
string $hash
) {
$this->newsletter = $newsletter; $this->newsletter = $newsletter;
$this->queue = $queue; $this->queue = $queue;
$this->url = $url; $this->url = $url;

View File

@ -37,7 +37,10 @@ class NewsletterOptionEntity {
*/ */
private $optionField; private $optionField;
public function __construct(NewsletterEntity $newsletter, NewsletterOptionFieldEntity $optionField) { public function __construct(
NewsletterEntity $newsletter,
NewsletterOptionFieldEntity $optionField
) {
$this->newsletter = $newsletter; $this->newsletter = $newsletter;
$this->optionField = $optionField; $this->optionField = $optionField;
} }

View File

@ -30,7 +30,10 @@ class NewsletterPostEntity {
*/ */
private $postId; private $postId;
public function __construct(NewsletterEntity $newsletter, int $postId) { public function __construct(
NewsletterEntity $newsletter,
int $postId
) {
$this->newsletter = $newsletter; $this->newsletter = $newsletter;
$this->postId = $postId; $this->postId = $postId;
} }

View File

@ -30,7 +30,10 @@ class NewsletterSegmentEntity {
*/ */
private $segment; private $segment;
public function __construct(NewsletterEntity $newsletter, SegmentEntity $segment) { public function __construct(
NewsletterEntity $newsletter,
SegmentEntity $segment
) {
$this->newsletter = $newsletter; $this->newsletter = $newsletter;
$this->segment = $segment; $this->segment = $segment;
} }

View File

@ -57,7 +57,9 @@ class NewsletterTemplateEntity {
*/ */
private $readonly = false; private $readonly = false;
public function __construct(string $name) { public function __construct(
string $name
) {
$this->name = $name; $this->name = $name;
} }

View File

@ -66,7 +66,11 @@ class SegmentEntity {
*/ */
private $averageEngagementScoreUpdatedAt; private $averageEngagementScoreUpdatedAt;
public function __construct(string $name, string $type, string $description) { public function __construct(
string $name,
string $type,
string $description
) {
$this->name = $name; $this->name = $name;
$this->type = $type; $this->type = $type;
$this->description = $description; $this->description = $description;

View File

@ -41,7 +41,11 @@ class StatisticsNewsletterEntity {
*/ */
private $sentAt; private $sentAt;
public function __construct(NewsletterEntity $newsletter, SendingQueueEntity $queue, SubscriberEntity $subscriber) { public function __construct(
NewsletterEntity $newsletter,
SendingQueueEntity $queue,
SubscriberEntity $subscriber
) {
$this->newsletter = $newsletter; $this->newsletter = $newsletter;
$this->queue = $queue; $this->queue = $queue;
$this->subscriber = $subscriber; $this->subscriber = $subscriber;

View File

@ -64,7 +64,14 @@ class StatisticsWooCommercePurchaseEntity {
*/ */
private $orderPriceTotal; private $orderPriceTotal;
public function __construct(NewsletterEntity $newsletter, SendingQueueEntity $queue, StatisticsClickEntity $click, int $orderId, string $orderCurrency, float $orderPriceTotal ) { public function __construct(
NewsletterEntity $newsletter,
SendingQueueEntity $queue,
StatisticsClickEntity $click,
int $orderId,
string $orderCurrency,
float $orderPriceTotal
) {
$this->newsletter = $newsletter; $this->newsletter = $newsletter;
$this->queue = $queue; $this->queue = $queue;
$this->click = $click; $this->click = $click;

View File

@ -30,7 +30,10 @@ class StatsNotificationEntity {
*/ */
private $task; private $task;
public function __construct(NewsletterEntity $newsletter, ScheduledTaskEntity $task) { public function __construct(
NewsletterEntity $newsletter,
ScheduledTaskEntity $task
) {
$this->newsletter = $newsletter; $this->newsletter = $newsletter;
$this->task = $task; $this->task = $task;
} }

View File

@ -26,7 +26,9 @@ class SubscriberIPEntity {
*/ */
private $createdAt; private $createdAt;
public function __construct(string $ip) { public function __construct(
string $ip
) {
$this->ip = $ip; $this->ip = $ip;
$this->createdAt = new Carbon(); $this->createdAt = new Carbon();
} }

View File

@ -35,7 +35,9 @@ class UserAgentEntity {
*/ */
private $userAgent; private $userAgent;
public function __construct(string $userAgent) { public function __construct(
string $userAgent
) {
$this->setUserAgent($userAgent); $this->setUserAgent($userAgent);
} }

View File

@ -12,7 +12,10 @@ class FeatureFlagsController {
/** @var FeatureFlagsRepository */ /** @var FeatureFlagsRepository */
private $featureFlagsRepository; private $featureFlagsRepository;
public function __construct(FeaturesController $featuresController, FeatureFlagsRepository $featureFlagsRepository) { public function __construct(
FeaturesController $featuresController,
FeatureFlagsRepository $featureFlagsRepository
) {
$this->featuresController = $featuresController; $this->featuresController = $featuresController;
$this->featureFlagsRepository = $featureFlagsRepository; $this->featureFlagsRepository = $featureFlagsRepository;
} }

View File

@ -16,7 +16,9 @@ class FeaturesController {
/** @var FeatureFlagsRepository */ /** @var FeatureFlagsRepository */
private $featureFlagsRepository; private $featureFlagsRepository;
public function __construct(FeatureFlagsRepository $featureFlagsRepository) { public function __construct(
FeatureFlagsRepository $featureFlagsRepository
) {
$this->featureFlagsRepository = $featureFlagsRepository; $this->featureFlagsRepository = $featureFlagsRepository;
} }

View File

@ -25,7 +25,9 @@ class ApiDataSanitizer {
], ],
]; ];
public function __construct(FormHtmlSanitizer $htmlSanitizer) { public function __construct(
FormHtmlSanitizer $htmlSanitizer
) {
$this->htmlSanitizer = $htmlSanitizer; $this->htmlSanitizer = $htmlSanitizer;
} }

View File

@ -18,7 +18,10 @@ class BlockRendererHelper {
/** @var WPFunctions */ /** @var WPFunctions */
protected $wp; protected $wp;
public function __construct(FieldNameObfuscator $fieldNameObfuscator, WPFunctions $wp) { public function __construct(
FieldNameObfuscator $fieldNameObfuscator,
WPFunctions $wp
) {
$this->fieldNameObfuscator = $fieldNameObfuscator; $this->fieldNameObfuscator = $fieldNameObfuscator;
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -16,7 +16,11 @@ class Checkbox {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(BlockRendererHelper $rendererHelper, BlockWrapperRenderer $wrapper, WPFunctions $wp) { public function __construct(
BlockRendererHelper $rendererHelper,
BlockWrapperRenderer $wrapper,
WPFunctions $wp
) {
$this->rendererHelper = $rendererHelper; $this->rendererHelper = $rendererHelper;
$this->wrapper = $wrapper; $this->wrapper = $wrapper;
$this->wp = $wp; $this->wp = $wp;

View File

@ -8,7 +8,9 @@ class Column {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(WPFunctions $wp) { public function __construct(
WPFunctions $wp
) {
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -8,7 +8,9 @@ class Columns {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(WPFunctions $wp) { public function __construct(
WPFunctions $wp
) {
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -8,7 +8,9 @@ class Divider {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(WPFunctions $wp) { public function __construct(
WPFunctions $wp
) {
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -8,7 +8,9 @@ class Heading {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(WPFunctions $wp) { public function __construct(
WPFunctions $wp
) {
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -6,7 +6,9 @@ class Html {
/** @var BlockRendererHelper */ /** @var BlockRendererHelper */
private $rendererHelper; private $rendererHelper;
public function __construct(BlockRendererHelper $rendererHelper) { public function __construct(
BlockRendererHelper $rendererHelper
) {
$this->rendererHelper = $rendererHelper; $this->rendererHelper = $rendererHelper;
} }

View File

@ -8,7 +8,9 @@ class Image {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(WPFunctions $wp) { public function __construct(
WPFunctions $wp
) {
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -8,7 +8,9 @@ class Paragraph {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(WPFunctions $wp) { public function __construct(
WPFunctions $wp
) {
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -16,7 +16,11 @@ class Radio {
/** @var BlockWrapperRenderer */ /** @var BlockWrapperRenderer */
private $wrapper; private $wrapper;
public function __construct(BlockRendererHelper $rendererHelper, BlockWrapperRenderer $wrapper, WPFunctions $wp) { public function __construct(
BlockRendererHelper $rendererHelper,
BlockWrapperRenderer $wrapper,
WPFunctions $wp
) {
$this->rendererHelper = $rendererHelper; $this->rendererHelper = $rendererHelper;
$this->wrapper = $wrapper; $this->wrapper = $wrapper;
$this->wp = $wp; $this->wp = $wp;

View File

@ -8,7 +8,9 @@ class BlockStylesRenderer {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(WPFunctions $wp) { public function __construct(
WPFunctions $wp
) {
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -8,7 +8,9 @@ class BlockWrapperRenderer {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(WPFunctions $wp) { public function __construct(
WPFunctions $wp
) {
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -44,7 +44,9 @@ class FormHtmlSanitizer {
's' => [], 's' => [],
]; ];
public function __construct(WPFunctions $wp) { public function __construct(
WPFunctions $wp
) {
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -7,7 +7,9 @@ class PreviewWidget extends \WP_Widget {
/** @var string */ /** @var string */
private $formHtml; private $formHtml;
public function __construct($formHtml) { public function __construct(
$formHtml
) {
$this->formHtml = $formHtml; $this->formHtml = $formHtml;
parent::__construct( parent::__construct(
'mailpoet_form_preview', 'mailpoet_form_preview',

View File

@ -91,7 +91,10 @@ EOL;
/** @var string */ /** @var string */
protected $assetsDirectory = ''; protected $assetsDirectory = '';
public function __construct(CdnAssetUrl $cdnAssetUrl, WPFunctions $wp) { public function __construct(
CdnAssetUrl $cdnAssetUrl,
WPFunctions $wp
) {
$this->cdnAssetUrl = $cdnAssetUrl; $this->cdnAssetUrl = $cdnAssetUrl;
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -140,7 +140,10 @@ class TemplateRepository {
Template18Widget::ID => Template18Widget::class, Template18Widget::ID => Template18Widget::class,
]; ];
public function __construct(CdnAssetUrl $cdnAssetUrl, WPFunctions $wp) { public function __construct(
CdnAssetUrl $cdnAssetUrl,
WPFunctions $wp
) {
$this->cdnAssetUrl = $cdnAssetUrl; $this->cdnAssetUrl = $cdnAssetUrl;
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -74,7 +74,9 @@ class CustomFonts {
/** @var Functions */ /** @var Functions */
private $wp; private $wp;
public function __construct(Functions $wp) { public function __construct(
Functions $wp
) {
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -12,7 +12,9 @@ class FieldNameObfuscator {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(WPFunctions $wp) { public function __construct(
WPFunctions $wp
) {
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -20,7 +20,11 @@ class Beacon {
/** @var SubscribersFeature */ /** @var SubscribersFeature */
private $subscribersFeature; private $subscribersFeature;
public function __construct(SettingsController $settings, WPFunctions $wp, SubscribersFeature $subscribersFeature) { public function __construct(
SettingsController $settings,
WPFunctions $wp,
SubscribersFeature $subscribersFeature
) {
$this->settings = $settings; $this->settings = $settings;
$this->wp = $wp; $this->wp = $wp;
$this->subscribersFeature = $subscribersFeature; $this->subscribersFeature = $subscribersFeature;

View File

@ -9,7 +9,10 @@ class BulkActionController {
/** @var Handler */ /** @var Handler */
private $handler; private $handler;
public function __construct(BulkActionFactory $factory, Handler $handler) { public function __construct(
BulkActionFactory $factory,
Handler $handler
) {
$this->factory = $factory; $this->factory = $factory;
$this->handler = $handler; $this->handler = $handler;
} }

View File

@ -10,7 +10,9 @@ abstract class ListingRepository {
/** @var QueryBuilder */ /** @var QueryBuilder */
protected $queryBuilder; protected $queryBuilder;
public function __construct(EntityManager $entityManager) { public function __construct(
EntityManager $entityManager
) {
$this->queryBuilder = $entityManager->createQueryBuilder(); $this->queryBuilder = $entityManager->createQueryBuilder();
} }

View File

@ -10,7 +10,9 @@ class PageLimit {
/** @var WPFunctions */ /** @var WPFunctions */
private $wp; private $wp;
public function __construct(WPFunctions $wp) { public function __construct(
WPFunctions $wp
) {
$this->wp = $wp; $this->wp = $wp;
} }

View File

@ -41,7 +41,10 @@ class LoggerFactory {
/** @var LogRepository */ /** @var LogRepository */
private $logRepository; private $logRepository;
public function __construct(LogRepository $logRepository, SettingsController $settings) { public function __construct(
LogRepository $logRepository,
SettingsController $settings
) {
$this->settings = $settings; $this->settings = $settings;
$this->logRepository = $logRepository; $this->logRepository = $logRepository;
} }

View File

@ -37,7 +37,10 @@ class Mailer {
const METHOD_PHPMAIL = 'PHPMail'; const METHOD_PHPMAIL = 'PHPMail';
const METHOD_SMTP = 'SMTP'; const METHOD_SMTP = 'SMTP';
public function __construct(SettingsController $settings = null, WPFunctions $wp = null) { public function __construct(
SettingsController $settings = null,
WPFunctions $wp = null
) {
if (!$settings) { if (!$settings) {
$settings = SettingsController::getInstance(); $settings = SettingsController::getInstance();
} }

View File

@ -39,7 +39,13 @@ class MailerError {
* @param int|null $retryInterval * @param int|null $retryInterval
* @param array $subscribersErrors * @param array $subscribersErrors
*/ */
public function __construct($operation, $level, $message = null, $retryInterval = null, array $subscribersErrors = []) { public function __construct(
$operation,
$level,
$message = null,
$retryInterval = null,
array $subscribersErrors = []
) {
$this->operation = $operation; $this->operation = $operation;
$this->level = $level; $this->level = $level;
$this->message = $message; $this->message = $message;

View File

@ -8,7 +8,9 @@ class BlacklistCheck {
/** @var Blacklist */ /** @var Blacklist */
private $blacklist; private $blacklist;
public function __construct(Blacklist $blacklist = null) { public function __construct(
Blacklist $blacklist = null
) {
if (is_null($blacklist)) { if (is_null($blacklist)) {
$blacklist = new Blacklist(); $blacklist = new Blacklist();
} }

View File

@ -26,7 +26,13 @@ class MailPoet {
/** @var BlacklistCheck */ /** @var BlacklistCheck */
private $blacklist; private $blacklist;
public function __construct($apiKey, $sender, $replyTo, MailPoetMapper $errorMapper, AuthorizedEmailsController $authorizedEmailsController) { public function __construct(
$apiKey,
$sender,
$replyTo,
MailPoetMapper $errorMapper,
AuthorizedEmailsController $authorizedEmailsController
) {
$this->api = new API($apiKey); $this->api = new API($apiKey);
$this->sender = $sender; $this->sender = $sender;
$this->replyTo = $replyTo; $this->replyTo = $replyTo;

View File

@ -21,7 +21,12 @@ class PHPMail {
/** @var BlacklistCheck */ /** @var BlacklistCheck */
private $blacklist; private $blacklist;
public function __construct($sender, $replyTo, $returnPath, PHPMailMapper $errorMapper) { public function __construct(
$sender,
$replyTo,
$returnPath,
PHPMailMapper $errorMapper
) {
$this->sender = $sender; $this->sender = $sender;
$this->replyTo = $replyTo; $this->replyTo = $replyTo;
$this->returnPath = ($returnPath) ? $this->returnPath = ($returnPath) ?

View File

@ -21,7 +21,12 @@ class SendGrid {
private $wp; private $wp;
public function __construct($apiKey, $sender, $replyTo, SendGridMapper $errorMapper) { public function __construct(
$apiKey,
$sender,
$replyTo,
SendGridMapper $errorMapper
) {
$this->apiKey = $apiKey; $this->apiKey = $apiKey;
$this->sender = $sender; $this->sender = $sender;
$this->replyTo = $replyTo; $this->replyTo = $replyTo;

Some files were not shown because too many files have changed in this diff Show More