diff --git a/lib/API/JSON/ErrorHandler.php b/lib/API/JSON/ErrorHandler.php index d79aab46ec..5963c251f7 100644 --- a/lib/API/JSON/ErrorHandler.php +++ b/lib/API/JSON/ErrorHandler.php @@ -11,7 +11,7 @@ class ErrorHandler { private $defaultErrors; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->defaultErrors = [ Error::UNKNOWN => $wp->__('An unknown error occurred.', 'mailpoet'), diff --git a/lib/API/JSON/ErrorResponse.php b/lib/API/JSON/ErrorResponse.php index 17c31f9f15..0c612fcf5f 100644 --- a/lib/API/JSON/ErrorResponse.php +++ b/lib/API/JSON/ErrorResponse.php @@ -8,9 +8,9 @@ class ErrorResponse extends Response { public $errors; public function __construct( - $errors = [], - $meta = [], - $status = self::STATUS_NOT_FOUND + $errors = [], + $meta = [], + $status = self::STATUS_NOT_FOUND ) { parent::__construct($status, $meta); $this->errors = $this->formatErrors($errors); diff --git a/lib/API/JSON/Response.php b/lib/API/JSON/Response.php index f1407941ad..359cce42bb 100644 --- a/lib/API/JSON/Response.php +++ b/lib/API/JSON/Response.php @@ -17,8 +17,8 @@ abstract class Response { public $meta; public function __construct( - $status, - $meta = [] + $status, + $meta = [] ) { $this->status = $status; $this->meta = $meta; diff --git a/lib/API/JSON/ResponseBuilders/FormsResponseBuilder.php b/lib/API/JSON/ResponseBuilders/FormsResponseBuilder.php index d9aaff1bb0..4f07d240b5 100644 --- a/lib/API/JSON/ResponseBuilders/FormsResponseBuilder.php +++ b/lib/API/JSON/ResponseBuilders/FormsResponseBuilder.php @@ -12,7 +12,7 @@ class FormsResponseBuilder { private $statisticsFormsRepository; public function __construct( - StatisticsFormsRepository $statisticsFormsRepository + StatisticsFormsRepository $statisticsFormsRepository ) { $this->statisticsFormsRepository = $statisticsFormsRepository; } diff --git a/lib/API/JSON/SuccessResponse.php b/lib/API/JSON/SuccessResponse.php index e948adc9a5..1995018e4d 100644 --- a/lib/API/JSON/SuccessResponse.php +++ b/lib/API/JSON/SuccessResponse.php @@ -6,9 +6,9 @@ class SuccessResponse extends Response { public $data; public function __construct( - $data = [], - $meta = [], - $status = self::STATUS_OK + $data = [], + $meta = [], + $status = self::STATUS_OK ) { parent::__construct($status, $meta); $this->data = $data; diff --git a/lib/API/JSON/v1/Analytics.php b/lib/API/JSON/v1/Analytics.php index 5c257d1bd1..f9a09efcf8 100644 --- a/lib/API/JSON/v1/Analytics.php +++ b/lib/API/JSON/v1/Analytics.php @@ -16,7 +16,7 @@ class Analytics extends APIEndpoint { ]; public function __construct( - Reporter $reporter + Reporter $reporter ) { $this->reporter = $reporter; } diff --git a/lib/API/JSON/v1/AutomatedLatestContent.php b/lib/API/JSON/v1/AutomatedLatestContent.php index d0e2921a83..dc48d2c237 100644 --- a/lib/API/JSON/v1/AutomatedLatestContent.php +++ b/lib/API/JSON/v1/AutomatedLatestContent.php @@ -16,8 +16,8 @@ class AutomatedLatestContent extends APIEndpoint { ]; public function __construct( - \MailPoet\Newsletter\AutomatedLatestContent $alc, - WPFunctions $wp + \MailPoet\Newsletter\AutomatedLatestContent $alc, + WPFunctions $wp ) { $this->ALC = $alc; $this->wp = $wp; diff --git a/lib/API/JSON/v1/FeatureFlags.php b/lib/API/JSON/v1/FeatureFlags.php index c3efee7ea7..557572e4c8 100644 --- a/lib/API/JSON/v1/FeatureFlags.php +++ b/lib/API/JSON/v1/FeatureFlags.php @@ -21,8 +21,8 @@ class FeatureFlags extends APIEndpoint { private $featureFlagsController; public function __construct( - FeaturesController $featuresController, - FeatureFlagsController $featureFlags + FeaturesController $featuresController, + FeatureFlagsController $featureFlags ) { $this->featuresController = $featuresController; $this->featureFlagsController = $featureFlags; diff --git a/lib/API/JSON/v1/MP2Migrator.php b/lib/API/JSON/v1/MP2Migrator.php index 3fffcb9af8..c849ac0deb 100644 --- a/lib/API/JSON/v1/MP2Migrator.php +++ b/lib/API/JSON/v1/MP2Migrator.php @@ -14,7 +14,7 @@ class MP2Migrator extends APIEndpoint { private $MP2Migrator; public function __construct( - \MailPoet\Config\MP2Migrator $MP2Migrator + \MailPoet\Config\MP2Migrator $MP2Migrator ) { $this->MP2Migrator = $MP2Migrator; } diff --git a/lib/API/JSON/v1/Mailer.php b/lib/API/JSON/v1/Mailer.php index d085c0fcff..bdadcfc098 100644 --- a/lib/API/JSON/v1/Mailer.php +++ b/lib/API/JSON/v1/Mailer.php @@ -31,10 +31,10 @@ class Mailer extends APIEndpoint { ]; public function __construct( - AuthorizedEmailsController $authorizedEmailsController, - SettingsController $settings, - Bridge $bridge, - MetaInfo $mailerMetaInfo + AuthorizedEmailsController $authorizedEmailsController, + SettingsController $settings, + Bridge $bridge, + MetaInfo $mailerMetaInfo ) { $this->authorizedEmailsController = $authorizedEmailsController; $this->settings = $settings; diff --git a/lib/API/JSON/v1/NewsletterLinks.php b/lib/API/JSON/v1/NewsletterLinks.php index 8cd8ca60ea..1bb49e39cc 100644 --- a/lib/API/JSON/v1/NewsletterLinks.php +++ b/lib/API/JSON/v1/NewsletterLinks.php @@ -16,7 +16,7 @@ class NewsletterLinks extends APIEndpoint { private $newsletterLinkRepository; public function __construct( - NewsletterLinkRepository $newsletterLinkRepository + NewsletterLinkRepository $newsletterLinkRepository ) { $this->newsletterLinkRepository = $newsletterLinkRepository; } diff --git a/lib/API/JSON/v1/Setup.php b/lib/API/JSON/v1/Setup.php index 5442632083..054027f18a 100644 --- a/lib/API/JSON/v1/Setup.php +++ b/lib/API/JSON/v1/Setup.php @@ -19,8 +19,8 @@ class Setup extends APIEndpoint { private $activator; public function __construct( - WPFunctions $wp, - Activator $activator + WPFunctions $wp, + Activator $activator ) { $this->wp = $wp; $this->activator = $activator; diff --git a/lib/API/JSON/v1/UserFlags.php b/lib/API/JSON/v1/UserFlags.php index 5f458c14e4..4a799d4a14 100644 --- a/lib/API/JSON/v1/UserFlags.php +++ b/lib/API/JSON/v1/UserFlags.php @@ -18,7 +18,7 @@ class UserFlags extends APIEndpoint { ]; public function __construct( - UserFlagsController $userFlags + UserFlagsController $userFlags ) { $this->userFlags = $userFlags; } diff --git a/lib/API/JSON/v1/WoocommerceSettings.php b/lib/API/JSON/v1/WoocommerceSettings.php index aca469a90a..e9802a9f8b 100644 --- a/lib/API/JSON/v1/WoocommerceSettings.php +++ b/lib/API/JSON/v1/WoocommerceSettings.php @@ -19,7 +19,7 @@ class WoocommerceSettings extends APIEndpoint { private $wp; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/AdminPages/Pages/ExperimentalFeatures.php b/lib/AdminPages/Pages/ExperimentalFeatures.php index 940a2a5f67..3f29c3ad7c 100644 --- a/lib/AdminPages/Pages/ExperimentalFeatures.php +++ b/lib/AdminPages/Pages/ExperimentalFeatures.php @@ -9,7 +9,7 @@ class ExperimentalFeatures { private $pageRenderer; public function __construct( - PageRenderer $pageRenderer + PageRenderer $pageRenderer ) { $this->pageRenderer = $pageRenderer; } diff --git a/lib/AdminPages/Pages/Help.php b/lib/AdminPages/Pages/Help.php index 9974ecd268..7d495b9c5c 100644 --- a/lib/AdminPages/Pages/Help.php +++ b/lib/AdminPages/Pages/Help.php @@ -25,10 +25,10 @@ class Help { private $helpscoutBeacon; public function __construct( - PageRenderer $pageRenderer, - State $tasksState, - CronHelper $cronHelper, - Beacon $helpscoutBeacon + PageRenderer $pageRenderer, + State $tasksState, + CronHelper $cronHelper, + Beacon $helpscoutBeacon ) { $this->pageRenderer = $pageRenderer; $this->tasksState = $tasksState; diff --git a/lib/AdminPages/Pages/MP2Migration.php b/lib/AdminPages/Pages/MP2Migration.php index a1a265a1b0..3535a5243f 100644 --- a/lib/AdminPages/Pages/MP2Migration.php +++ b/lib/AdminPages/Pages/MP2Migration.php @@ -13,8 +13,8 @@ class MP2Migration { private $mp2Migrator; public function __construct( - PageRenderer $pageRenderer, - MP2Migrator $mp2Migrator + PageRenderer $pageRenderer, + MP2Migrator $mp2Migrator ) { $this->pageRenderer = $pageRenderer; $this->mp2Migrator = $mp2Migrator; diff --git a/lib/AdminPages/Pages/Premium.php b/lib/AdminPages/Pages/Premium.php index 174f7d35ae..1137ad5c19 100644 --- a/lib/AdminPages/Pages/Premium.php +++ b/lib/AdminPages/Pages/Premium.php @@ -17,9 +17,9 @@ class Premium { private $subscribersFeature; public function __construct( - PageRenderer $pageRenderer, - WPFunctions $wp, - SubscribersFeature $subscribersFeature + PageRenderer $pageRenderer, + WPFunctions $wp, + SubscribersFeature $subscribersFeature ) { $this->pageRenderer = $pageRenderer; $this->wp = $wp; diff --git a/lib/AdminPages/Pages/SubscribersExport.php b/lib/AdminPages/Pages/SubscribersExport.php index ad43ecd696..38b855d8a3 100644 --- a/lib/AdminPages/Pages/SubscribersExport.php +++ b/lib/AdminPages/Pages/SubscribersExport.php @@ -10,7 +10,7 @@ class SubscribersExport { private $pageRenderer; public function __construct( - PageRenderer $pageRenderer + PageRenderer $pageRenderer ) { $this->pageRenderer = $pageRenderer; } diff --git a/lib/AdminPages/Pages/SubscribersImport.php b/lib/AdminPages/Pages/SubscribersImport.php index f5c706d293..af6da7688c 100644 --- a/lib/AdminPages/Pages/SubscribersImport.php +++ b/lib/AdminPages/Pages/SubscribersImport.php @@ -19,9 +19,9 @@ class SubscribersImport { private $dateBlock; public function __construct( - PageRenderer $pageRenderer, - Installation $installation, - Block\Date $dateBlock + PageRenderer $pageRenderer, + Installation $installation, + Block\Date $dateBlock ) { $this->pageRenderer = $pageRenderer; $this->installation = $installation; diff --git a/lib/AdminPages/Pages/WooCommerceSetup.php b/lib/AdminPages/Pages/WooCommerceSetup.php index 30c30f2d06..44d64d2acd 100644 --- a/lib/AdminPages/Pages/WooCommerceSetup.php +++ b/lib/AdminPages/Pages/WooCommerceSetup.php @@ -14,8 +14,8 @@ class WooCommerceSetup { private $wp; public function __construct( - PageRenderer $pageRenderer, - WPFunctions $wp + PageRenderer $pageRenderer, + WPFunctions $wp ) { $this->pageRenderer = $pageRenderer; $this->wp = $wp; diff --git a/lib/Analytics/Analytics.php b/lib/Analytics/Analytics.php index d329a9c514..7e0e1d6e1a 100644 --- a/lib/Analytics/Analytics.php +++ b/lib/Analytics/Analytics.php @@ -22,8 +22,8 @@ class Analytics { private $wp; public function __construct( - Reporter $reporter, - SettingsController $settingsController + Reporter $reporter, + SettingsController $settingsController ) { $this->reporter = $reporter; $this->settings = $settingsController; diff --git a/lib/AutomaticEmails/WooCommerce/Events/AbandonedCartPageVisitTracker.php b/lib/AutomaticEmails/WooCommerce/Events/AbandonedCartPageVisitTracker.php index 2e3b53f3b6..249c15bc7e 100644 --- a/lib/AutomaticEmails/WooCommerce/Events/AbandonedCartPageVisitTracker.php +++ b/lib/AutomaticEmails/WooCommerce/Events/AbandonedCartPageVisitTracker.php @@ -21,9 +21,9 @@ class AbandonedCartPageVisitTracker { private $cookies; public function __construct( - WPFunctions $wp, - WooCommerceHelper $wooCommerceHelper, - Cookies $cookies + WPFunctions $wp, + WooCommerceHelper $wooCommerceHelper, + Cookies $cookies ) { $this->wp = $wp; $this->wooCommerceHelper = $wooCommerceHelper; diff --git a/lib/AutomaticEmails/WooCommerce/Events/FirstPurchase.php b/lib/AutomaticEmails/WooCommerce/Events/FirstPurchase.php index 5610cd472c..83fb34dd0c 100644 --- a/lib/AutomaticEmails/WooCommerce/Events/FirstPurchase.php +++ b/lib/AutomaticEmails/WooCommerce/Events/FirstPurchase.php @@ -32,7 +32,7 @@ class FirstPurchase { private $repository; public function __construct( - WCHelper $helper = null + WCHelper $helper = null ) { if ($helper === null) { $helper = new WCHelper(); diff --git a/lib/AutomaticEmails/WooCommerce/Events/PurchasedInCategory.php b/lib/AutomaticEmails/WooCommerce/Events/PurchasedInCategory.php index 9717f84ad6..deec1c7fa5 100644 --- a/lib/AutomaticEmails/WooCommerce/Events/PurchasedInCategory.php +++ b/lib/AutomaticEmails/WooCommerce/Events/PurchasedInCategory.php @@ -27,7 +27,7 @@ class PurchasedInCategory { private $repository; public function __construct( - WCHelper $woocommerceHelper = null + WCHelper $woocommerceHelper = null ) { if ($woocommerceHelper === null) { $woocommerceHelper = new WCHelper(); diff --git a/lib/AutomaticEmails/WooCommerce/Events/PurchasedProduct.php b/lib/AutomaticEmails/WooCommerce/Events/PurchasedProduct.php index 36148a4fc3..3707c0226c 100644 --- a/lib/AutomaticEmails/WooCommerce/Events/PurchasedProduct.php +++ b/lib/AutomaticEmails/WooCommerce/Events/PurchasedProduct.php @@ -29,7 +29,7 @@ class PurchasedProduct { private $repository; public function __construct( - WCHelper $helper = null + WCHelper $helper = null ) { if ($helper === null) { $helper = new WCHelper(); diff --git a/lib/Cache/TransientCache.php b/lib/Cache/TransientCache.php index da000ec7b6..d7ab61e1a5 100644 --- a/lib/Cache/TransientCache.php +++ b/lib/Cache/TransientCache.php @@ -13,7 +13,7 @@ class TransientCache { private $wp; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Config/Activator.php b/lib/Config/Activator.php index 5d58767a99..044e286d9e 100644 --- a/lib/Config/Activator.php +++ b/lib/Config/Activator.php @@ -20,9 +20,9 @@ class Activator { private $wp; public function __construct( - SettingsController $settings, - Populator $populator, - WPFunctions $wp + SettingsController $settings, + Populator $populator, + WPFunctions $wp ) { $this->settings = $settings; $this->populator = $populator; diff --git a/lib/Config/Capabilities.php b/lib/Config/Capabilities.php index fcf82d138a..b05f7be9fd 100644 --- a/lib/Config/Capabilities.php +++ b/lib/Config/Capabilities.php @@ -15,8 +15,8 @@ class Capabilities { private $accessControl; public function __construct( - $renderer = null, - WPFunctions $wp = null + $renderer = null, + WPFunctions $wp = null ) { if ($renderer !== null) { $this->renderer = $renderer; diff --git a/lib/Config/DatabaseInitializer.php b/lib/Config/DatabaseInitializer.php index f87f3544fd..67dabf8929 100644 --- a/lib/Config/DatabaseInitializer.php +++ b/lib/Config/DatabaseInitializer.php @@ -9,7 +9,7 @@ class DatabaseInitializer { private $diContainer; public function __construct( - ContainerInterface $diContainer + ContainerInterface $diContainer ) { $this->diContainer = $diContainer; } diff --git a/lib/Config/Installer.php b/lib/Config/Installer.php index 1cc3c1c18e..e5983f9c49 100644 --- a/lib/Config/Installer.php +++ b/lib/Config/Installer.php @@ -17,7 +17,7 @@ class Installer { private $settings; public function __construct( - $slug + $slug ) { $this->slug = $slug; $this->settings = SettingsController::getInstance(); diff --git a/lib/Config/MP2Migrator.php b/lib/Config/MP2Migrator.php index 8f1893af71..fac7c1ac5e 100644 --- a/lib/Config/MP2Migrator.php +++ b/lib/Config/MP2Migrator.php @@ -43,8 +43,8 @@ class MP2Migrator { private $mp2UserListTable; public function __construct( - SettingsController $settings, - Activator $activator + SettingsController $settings, + Activator $activator ) { $this->defineMP2Tables(); $logFilename = 'mp2migration.log'; diff --git a/lib/Config/PluginActivatedHook.php b/lib/Config/PluginActivatedHook.php index 2e530455a1..34f3bbe316 100644 --- a/lib/Config/PluginActivatedHook.php +++ b/lib/Config/PluginActivatedHook.php @@ -8,7 +8,7 @@ class PluginActivatedHook { private $deferredAdminNotices; public function __construct( - DeferredAdminNotices $deferredAdminNotices + DeferredAdminNotices $deferredAdminNotices ) { $this->deferredAdminNotices = $deferredAdminNotices; } diff --git a/lib/Config/Renderer.php b/lib/Config/Renderer.php index aa050a328c..67d7505c58 100644 --- a/lib/Config/Renderer.php +++ b/lib/Config/Renderer.php @@ -20,8 +20,8 @@ class Renderer { public $assetsManifestCss; public function __construct( - $cachingEnabled = false, - $debuggingEnabled = false + $cachingEnabled = false, + $debuggingEnabled = false ) { $this->cachingEnabled = $cachingEnabled; $this->debuggingEnabled = $debuggingEnabled; diff --git a/lib/Config/RequirementsChecker.php b/lib/Config/RequirementsChecker.php index d2f0b7d369..f80c19eb56 100644 --- a/lib/Config/RequirementsChecker.php +++ b/lib/Config/RequirementsChecker.php @@ -20,7 +20,7 @@ class RequirementsChecker { ]; public function __construct( - $displayErrorNotice = true + $displayErrorNotice = true ) { $this->displayErrorNotice = $displayErrorNotice; } diff --git a/lib/Config/Router.php b/lib/Config/Router.php index 02a7635724..f789915992 100644 --- a/lib/Config/Router.php +++ b/lib/Config/Router.php @@ -9,7 +9,7 @@ class Router { private $wp; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Config/Updater.php b/lib/Config/Updater.php index de98b882e7..162f348b7e 100644 --- a/lib/Config/Updater.php +++ b/lib/Config/Updater.php @@ -16,9 +16,9 @@ class Updater { private $settings; public function __construct( - $pluginName, - $slug, - $version + $pluginName, + $slug, + $version ) { $this->plugin = WPFunctions::get()->pluginBasename($pluginName); $this->slug = $slug; diff --git a/lib/Cron/CronHelper.php b/lib/Cron/CronHelper.php index ae7d2ac939..622e764ee8 100644 --- a/lib/Cron/CronHelper.php +++ b/lib/Cron/CronHelper.php @@ -25,8 +25,8 @@ class CronHelper { private $wp; public function __construct( - SettingsController $settings, - WPFunctions $wp + SettingsController $settings, + WPFunctions $wp ) { $this->settings = $settings; $this->wp = $wp; diff --git a/lib/Cron/CronWorkerRunner.php b/lib/Cron/CronWorkerRunner.php index 5532a761c7..0ee10f7b94 100644 --- a/lib/Cron/CronWorkerRunner.php +++ b/lib/Cron/CronWorkerRunner.php @@ -24,9 +24,9 @@ class CronWorkerRunner { private $wp; public function __construct( - CronHelper $cronHelper, - CronWorkerScheduler $cronWorkerScheduler, - WPFunctions $wp + CronHelper $cronHelper, + CronWorkerScheduler $cronWorkerScheduler, + WPFunctions $wp ) { $this->timer = microtime(true); $this->cronHelper = $cronHelper; diff --git a/lib/Cron/DaemonHttpRunner.php b/lib/Cron/DaemonHttpRunner.php index 3998118a44..971eb34b09 100644 --- a/lib/Cron/DaemonHttpRunner.php +++ b/lib/Cron/DaemonHttpRunner.php @@ -27,10 +27,10 @@ class DaemonHttpRunner { private $wordpressTrigger; public function __construct( - Daemon $daemon = null, - CronHelper $cronHelper, - SettingsController $settings, - WordPress $wordpressTrigger + Daemon $daemon = null, + CronHelper $cronHelper, + SettingsController $settings, + WordPress $wordpressTrigger ) { $this->cronHelper = $cronHelper; $this->settingsDaemonData = $this->cronHelper->getDaemon(); diff --git a/lib/Cron/Supervisor.php b/lib/Cron/Supervisor.php index a4f5306071..8b4d19da58 100644 --- a/lib/Cron/Supervisor.php +++ b/lib/Cron/Supervisor.php @@ -10,7 +10,7 @@ class Supervisor { private $cronHelper; public function __construct( - CronHelper $cronHelper + CronHelper $cronHelper ) { $this->cronHelper = $cronHelper; } diff --git a/lib/Cron/Triggers/MailPoet.php b/lib/Cron/Triggers/MailPoet.php index 782450bb12..f64b541358 100644 --- a/lib/Cron/Triggers/MailPoet.php +++ b/lib/Cron/Triggers/MailPoet.php @@ -9,7 +9,7 @@ class MailPoet { private $supervisor; public function __construct( - Supervisor $supervisor + Supervisor $supervisor ) { $this->supervisor = $supervisor; } diff --git a/lib/Cron/Workers/AuthorizedSendingEmailsCheck.php b/lib/Cron/Workers/AuthorizedSendingEmailsCheck.php index 3c6ffcc534..a12b666d77 100644 --- a/lib/Cron/Workers/AuthorizedSendingEmailsCheck.php +++ b/lib/Cron/Workers/AuthorizedSendingEmailsCheck.php @@ -14,7 +14,7 @@ class AuthorizedSendingEmailsCheck extends SimpleWorker { private $authorizedEmailsController; public function __construct( - AuthorizedEmailsController $authorizedEmailsController + AuthorizedEmailsController $authorizedEmailsController ) { $this->authorizedEmailsController = $authorizedEmailsController; parent::__construct(); diff --git a/lib/Cron/Workers/Beamer.php b/lib/Cron/Workers/Beamer.php index aa43356d41..0f1afc8926 100644 --- a/lib/Cron/Workers/Beamer.php +++ b/lib/Cron/Workers/Beamer.php @@ -16,8 +16,8 @@ class Beamer extends SimpleWorker { private $settings; public function __construct( - SettingsController $settings, - WPFunctions $wp + SettingsController $settings, + WPFunctions $wp ) { parent::__construct($wp); $this->settings = $settings; diff --git a/lib/Cron/Workers/KeyCheck/PremiumKeyCheck.php b/lib/Cron/Workers/KeyCheck/PremiumKeyCheck.php index 889b9dec20..18236a496d 100644 --- a/lib/Cron/Workers/KeyCheck/PremiumKeyCheck.php +++ b/lib/Cron/Workers/KeyCheck/PremiumKeyCheck.php @@ -12,7 +12,7 @@ class PremiumKeyCheck extends KeyCheckWorker { private $settings; public function __construct( - SettingsController $settings + SettingsController $settings ) { $this->settings = $settings; parent::__construct(); diff --git a/lib/Cron/Workers/KeyCheck/SendingServiceKeyCheck.php b/lib/Cron/Workers/KeyCheck/SendingServiceKeyCheck.php index 74a516d63a..997b3b6f60 100644 --- a/lib/Cron/Workers/KeyCheck/SendingServiceKeyCheck.php +++ b/lib/Cron/Workers/KeyCheck/SendingServiceKeyCheck.php @@ -19,8 +19,8 @@ class SendingServiceKeyCheck extends KeyCheckWorker { private $servicesChecker; public function __construct( - SettingsController $settings, - ServicesChecker $servicesChecker + SettingsController $settings, + ServicesChecker $servicesChecker ) { $this->settings = $settings; $this->servicesChecker = $servicesChecker; diff --git a/lib/Cron/Workers/SendingQueue/SendingErrorHandler.php b/lib/Cron/Workers/SendingQueue/SendingErrorHandler.php index 67f8614ad3..002ce2faf4 100644 --- a/lib/Cron/Workers/SendingQueue/SendingErrorHandler.php +++ b/lib/Cron/Workers/SendingQueue/SendingErrorHandler.php @@ -11,7 +11,7 @@ class SendingErrorHandler { private $throttlingHandler; public function __construct( - SendingThrottlingHandler $throttlingHandler + SendingThrottlingHandler $throttlingHandler ) { $this->throttlingHandler = $throttlingHandler; } diff --git a/lib/Cron/Workers/SendingQueue/Tasks/Mailer.php b/lib/Cron/Workers/SendingQueue/Tasks/Mailer.php index 8203b23aaa..128c6ffaa3 100644 --- a/lib/Cron/Workers/SendingQueue/Tasks/Mailer.php +++ b/lib/Cron/Workers/SendingQueue/Tasks/Mailer.php @@ -9,7 +9,7 @@ class Mailer { public $mailer; public function __construct( - $mailer = false + $mailer = false ) { $this->mailer = ($mailer) ? $mailer : $this->configureMailer(); } diff --git a/lib/Cron/Workers/SimpleWorker.php b/lib/Cron/Workers/SimpleWorker.php index d923485f6c..8ab948e747 100644 --- a/lib/Cron/Workers/SimpleWorker.php +++ b/lib/Cron/Workers/SimpleWorker.php @@ -28,7 +28,7 @@ abstract class SimpleWorker implements CronWorkerInterface { protected $wp; public function __construct( - WPFunctions $wp = null + WPFunctions $wp = null ) { if (static::TASK_TYPE === null) { throw new \Exception('Constant TASK_TYPE is not defined on subclass ' . get_class($this)); diff --git a/lib/Cron/Workers/WooCommerceSync.php b/lib/Cron/Workers/WooCommerceSync.php index 7f75d4a84e..6778d8b24e 100644 --- a/lib/Cron/Workers/WooCommerceSync.php +++ b/lib/Cron/Workers/WooCommerceSync.php @@ -18,8 +18,8 @@ class WooCommerceSync extends SimpleWorker { private $woocommerceHelper; public function __construct( - WooCommerceSegment $woocommerceSegment, - WooCommerceHelper $woocommerceHelper + WooCommerceSegment $woocommerceSegment, + WooCommerceHelper $woocommerceHelper ) { $this->woocommerceSegment = $woocommerceSegment; $this->woocommerceHelper = $woocommerceHelper; diff --git a/lib/Cron/Workers/WorkersFactory.php b/lib/Cron/Workers/WorkersFactory.php index 627c271539..86a9af95af 100644 --- a/lib/Cron/Workers/WorkersFactory.php +++ b/lib/Cron/Workers/WorkersFactory.php @@ -18,7 +18,7 @@ class WorkersFactory { private $container; public function __construct( - ContainerWrapper $container + ContainerWrapper $container ) { $this->container = $container; } diff --git a/lib/DI/ContainerFactory.php b/lib/DI/ContainerFactory.php index c2ae8170e5..0ab316c4d5 100644 --- a/lib/DI/ContainerFactory.php +++ b/lib/DI/ContainerFactory.php @@ -11,7 +11,7 @@ class ContainerFactory { private $configurator; public function __construct( - IContainerConfigurator $configurator + IContainerConfigurator $configurator ) { $this->configurator = $configurator; } diff --git a/lib/DI/ContainerWrapper.php b/lib/DI/ContainerWrapper.php index 63b3ee3ea9..fc26fa874b 100644 --- a/lib/DI/ContainerWrapper.php +++ b/lib/DI/ContainerWrapper.php @@ -18,8 +18,8 @@ class ContainerWrapper implements ContainerInterface { private static $instance; public function __construct( - Container $freeContainer, - Container $premiumContainer = null + Container $freeContainer, + Container $premiumContainer = null ) { $this->freeContainer = $freeContainer; $this->premiumContainer = $premiumContainer; diff --git a/lib/Entities/DynamicSegmentFilterData.php b/lib/Entities/DynamicSegmentFilterData.php index c1449f5863..a9caa09fc7 100644 --- a/lib/Entities/DynamicSegmentFilterData.php +++ b/lib/Entities/DynamicSegmentFilterData.php @@ -24,7 +24,7 @@ class DynamicSegmentFilterData { private $filterData; public function __construct( - array $filterData + array $filterData ) { $this->filterData = $filterData; } diff --git a/lib/Entities/DynamicSegmentFilterEntity.php b/lib/Entities/DynamicSegmentFilterEntity.php index e88ed8abce..d6e08eb6c6 100644 --- a/lib/Entities/DynamicSegmentFilterEntity.php +++ b/lib/Entities/DynamicSegmentFilterEntity.php @@ -31,8 +31,8 @@ class DynamicSegmentFilterEntity { private $filterData; public function __construct( - SegmentEntity $segment, - DynamicSegmentFilterData $filterData + SegmentEntity $segment, + DynamicSegmentFilterData $filterData ) { $this->segment = $segment; $this->filterData = $filterData; diff --git a/lib/Entities/FeatureFlagEntity.php b/lib/Entities/FeatureFlagEntity.php index 41cc37b84e..8e629d6193 100644 --- a/lib/Entities/FeatureFlagEntity.php +++ b/lib/Entities/FeatureFlagEntity.php @@ -33,8 +33,8 @@ class FeatureFlagEntity { * @param bool|null $value */ public function __construct( - $name, - $value = null + $name, + $value = null ) { $this->name = $name; $this->value = $value; diff --git a/lib/Entities/FormEntity.php b/lib/Entities/FormEntity.php index f084f6a5ea..f901844458 100644 --- a/lib/Entities/FormEntity.php +++ b/lib/Entities/FormEntity.php @@ -84,7 +84,7 @@ class FormEntity { private $styles; public function __construct( - $name + $name ) { $this->name = $name; $this->status = self::STATUS_ENABLED; diff --git a/lib/Entities/NewsletterLinkEntity.php b/lib/Entities/NewsletterLinkEntity.php index b1c7d32b0c..498a60c322 100644 --- a/lib/Entities/NewsletterLinkEntity.php +++ b/lib/Entities/NewsletterLinkEntity.php @@ -55,10 +55,10 @@ class NewsletterLinkEntity { private $clicks; public function __construct( - NewsletterEntity $newsletter, - SendingQueueEntity $queue, - string $url, - string $hash + NewsletterEntity $newsletter, + SendingQueueEntity $queue, + string $url, + string $hash ) { $this->newsletter = $newsletter; $this->queue = $queue; diff --git a/lib/Entities/NewsletterOptionEntity.php b/lib/Entities/NewsletterOptionEntity.php index 1ad95ade1a..5ecc59f087 100644 --- a/lib/Entities/NewsletterOptionEntity.php +++ b/lib/Entities/NewsletterOptionEntity.php @@ -38,8 +38,8 @@ class NewsletterOptionEntity { private $optionField; public function __construct( - NewsletterEntity $newsletter, - NewsletterOptionFieldEntity $optionField + NewsletterEntity $newsletter, + NewsletterOptionFieldEntity $optionField ) { $this->newsletter = $newsletter; $this->optionField = $optionField; diff --git a/lib/Entities/NewsletterPostEntity.php b/lib/Entities/NewsletterPostEntity.php index ca9f4a51ca..fb10631cfd 100644 --- a/lib/Entities/NewsletterPostEntity.php +++ b/lib/Entities/NewsletterPostEntity.php @@ -31,8 +31,8 @@ class NewsletterPostEntity { private $postId; public function __construct( - NewsletterEntity $newsletter, - int $postId + NewsletterEntity $newsletter, + int $postId ) { $this->newsletter = $newsletter; $this->postId = $postId; diff --git a/lib/Entities/NewsletterSegmentEntity.php b/lib/Entities/NewsletterSegmentEntity.php index 6a3e95051f..79f10f9f26 100644 --- a/lib/Entities/NewsletterSegmentEntity.php +++ b/lib/Entities/NewsletterSegmentEntity.php @@ -31,8 +31,8 @@ class NewsletterSegmentEntity { private $segment; public function __construct( - NewsletterEntity $newsletter, - SegmentEntity $segment + NewsletterEntity $newsletter, + SegmentEntity $segment ) { $this->newsletter = $newsletter; $this->segment = $segment; diff --git a/lib/Entities/SegmentEntity.php b/lib/Entities/SegmentEntity.php index b293d4cd7a..121f73e8a2 100644 --- a/lib/Entities/SegmentEntity.php +++ b/lib/Entities/SegmentEntity.php @@ -67,9 +67,9 @@ class SegmentEntity { private $averageEngagementScoreUpdatedAt; public function __construct( - string $name, - string $type, - string $description + string $name, + string $type, + string $description ) { $this->name = $name; $this->type = $type; diff --git a/lib/Entities/StatisticsNewsletterEntity.php b/lib/Entities/StatisticsNewsletterEntity.php index 2f16f96b53..399b1c85bb 100644 --- a/lib/Entities/StatisticsNewsletterEntity.php +++ b/lib/Entities/StatisticsNewsletterEntity.php @@ -42,9 +42,9 @@ class StatisticsNewsletterEntity { private $sentAt; public function __construct( - NewsletterEntity $newsletter, - SendingQueueEntity $queue, - SubscriberEntity $subscriber + NewsletterEntity $newsletter, + SendingQueueEntity $queue, + SubscriberEntity $subscriber ) { $this->newsletter = $newsletter; $this->queue = $queue; diff --git a/lib/Entities/StatisticsWooCommercePurchaseEntity.php b/lib/Entities/StatisticsWooCommercePurchaseEntity.php index 9b14108772..c76c6bc8c7 100644 --- a/lib/Entities/StatisticsWooCommercePurchaseEntity.php +++ b/lib/Entities/StatisticsWooCommercePurchaseEntity.php @@ -65,12 +65,12 @@ class StatisticsWooCommercePurchaseEntity { private $orderPriceTotal; public function __construct( - NewsletterEntity $newsletter, - SendingQueueEntity $queue, - StatisticsClickEntity $click, - int $orderId, - string $orderCurrency, - float $orderPriceTotal + NewsletterEntity $newsletter, + SendingQueueEntity $queue, + StatisticsClickEntity $click, + int $orderId, + string $orderCurrency, + float $orderPriceTotal ) { $this->newsletter = $newsletter; $this->queue = $queue; diff --git a/lib/Entities/StatsNotificationEntity.php b/lib/Entities/StatsNotificationEntity.php index 36e5cd09f0..685f1fcaf5 100644 --- a/lib/Entities/StatsNotificationEntity.php +++ b/lib/Entities/StatsNotificationEntity.php @@ -31,8 +31,8 @@ class StatsNotificationEntity { private $task; public function __construct( - NewsletterEntity $newsletter, - ScheduledTaskEntity $task + NewsletterEntity $newsletter, + ScheduledTaskEntity $task ) { $this->newsletter = $newsletter; $this->task = $task; diff --git a/lib/Entities/SubscriberIPEntity.php b/lib/Entities/SubscriberIPEntity.php index 4f737467f4..b6efa1ab46 100644 --- a/lib/Entities/SubscriberIPEntity.php +++ b/lib/Entities/SubscriberIPEntity.php @@ -27,7 +27,7 @@ class SubscriberIPEntity { private $createdAt; public function __construct( - string $ip + string $ip ) { $this->ip = $ip; $this->createdAt = new Carbon(); diff --git a/lib/Entities/UserAgentEntity.php b/lib/Entities/UserAgentEntity.php index 6f75d982fe..6977c56deb 100644 --- a/lib/Entities/UserAgentEntity.php +++ b/lib/Entities/UserAgentEntity.php @@ -36,7 +36,7 @@ class UserAgentEntity { private $userAgent; public function __construct( - string $userAgent + string $userAgent ) { $this->setUserAgent($userAgent); } diff --git a/lib/Features/FeatureFlagsController.php b/lib/Features/FeatureFlagsController.php index e02ea2f203..2d774194c9 100644 --- a/lib/Features/FeatureFlagsController.php +++ b/lib/Features/FeatureFlagsController.php @@ -13,8 +13,8 @@ class FeatureFlagsController { private $featureFlagsRepository; public function __construct( - FeaturesController $featuresController, - FeatureFlagsRepository $featureFlagsRepository + FeaturesController $featuresController, + FeatureFlagsRepository $featureFlagsRepository ) { $this->featuresController = $featuresController; $this->featureFlagsRepository = $featureFlagsRepository; diff --git a/lib/Features/FeaturesController.php b/lib/Features/FeaturesController.php index dcaf3acb61..279881e07b 100644 --- a/lib/Features/FeaturesController.php +++ b/lib/Features/FeaturesController.php @@ -17,7 +17,7 @@ class FeaturesController { private $featureFlagsRepository; public function __construct( - FeatureFlagsRepository $featureFlagsRepository + FeatureFlagsRepository $featureFlagsRepository ) { $this->featureFlagsRepository = $featureFlagsRepository; } diff --git a/lib/Form/ApiDataSanitizer.php b/lib/Form/ApiDataSanitizer.php index 4a3bdb946d..e9af2a8e87 100644 --- a/lib/Form/ApiDataSanitizer.php +++ b/lib/Form/ApiDataSanitizer.php @@ -26,7 +26,7 @@ class ApiDataSanitizer { ]; public function __construct( - FormHtmlSanitizer $htmlSanitizer + FormHtmlSanitizer $htmlSanitizer ) { $this->htmlSanitizer = $htmlSanitizer; } diff --git a/lib/Form/Block/BlockRendererHelper.php b/lib/Form/Block/BlockRendererHelper.php index 85aed43443..24806af1f6 100644 --- a/lib/Form/Block/BlockRendererHelper.php +++ b/lib/Form/Block/BlockRendererHelper.php @@ -19,8 +19,8 @@ class BlockRendererHelper { protected $wp; public function __construct( - FieldNameObfuscator $fieldNameObfuscator, - WPFunctions $wp + FieldNameObfuscator $fieldNameObfuscator, + WPFunctions $wp ) { $this->fieldNameObfuscator = $fieldNameObfuscator; $this->wp = $wp; diff --git a/lib/Form/Block/Checkbox.php b/lib/Form/Block/Checkbox.php index 4185ddd422..3850482bd9 100644 --- a/lib/Form/Block/Checkbox.php +++ b/lib/Form/Block/Checkbox.php @@ -17,9 +17,9 @@ class Checkbox { private $wp; public function __construct( - BlockRendererHelper $rendererHelper, - BlockWrapperRenderer $wrapper, - WPFunctions $wp + BlockRendererHelper $rendererHelper, + BlockWrapperRenderer $wrapper, + WPFunctions $wp ) { $this->rendererHelper = $rendererHelper; $this->wrapper = $wrapper; diff --git a/lib/Form/Block/Column.php b/lib/Form/Block/Column.php index 627345ebd4..8f91cbe9fb 100644 --- a/lib/Form/Block/Column.php +++ b/lib/Form/Block/Column.php @@ -9,7 +9,7 @@ class Column { private $wp; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Form/Block/Columns.php b/lib/Form/Block/Columns.php index 080932e347..8874d893f3 100644 --- a/lib/Form/Block/Columns.php +++ b/lib/Form/Block/Columns.php @@ -9,7 +9,7 @@ class Columns { private $wp; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Form/Block/Divider.php b/lib/Form/Block/Divider.php index 57935a7382..819a7e06b7 100644 --- a/lib/Form/Block/Divider.php +++ b/lib/Form/Block/Divider.php @@ -9,7 +9,7 @@ class Divider { private $wp; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Form/Block/Heading.php b/lib/Form/Block/Heading.php index a4aee5a14d..2325d33e6a 100644 --- a/lib/Form/Block/Heading.php +++ b/lib/Form/Block/Heading.php @@ -9,7 +9,7 @@ class Heading { private $wp; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Form/Block/Html.php b/lib/Form/Block/Html.php index a7b47e384e..b745de5baa 100644 --- a/lib/Form/Block/Html.php +++ b/lib/Form/Block/Html.php @@ -7,7 +7,7 @@ class Html { private $rendererHelper; public function __construct( - BlockRendererHelper $rendererHelper + BlockRendererHelper $rendererHelper ) { $this->rendererHelper = $rendererHelper; } diff --git a/lib/Form/Block/Image.php b/lib/Form/Block/Image.php index 63a8b305a4..2f9e8a86c7 100644 --- a/lib/Form/Block/Image.php +++ b/lib/Form/Block/Image.php @@ -9,7 +9,7 @@ class Image { private $wp; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Form/Block/Paragraph.php b/lib/Form/Block/Paragraph.php index 4198780033..6f1709bfde 100644 --- a/lib/Form/Block/Paragraph.php +++ b/lib/Form/Block/Paragraph.php @@ -9,7 +9,7 @@ class Paragraph { private $wp; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Form/Block/Radio.php b/lib/Form/Block/Radio.php index ddf7fd7220..a01e700479 100644 --- a/lib/Form/Block/Radio.php +++ b/lib/Form/Block/Radio.php @@ -17,9 +17,9 @@ class Radio { private $wrapper; public function __construct( - BlockRendererHelper $rendererHelper, - BlockWrapperRenderer $wrapper, - WPFunctions $wp + BlockRendererHelper $rendererHelper, + BlockWrapperRenderer $wrapper, + WPFunctions $wp ) { $this->rendererHelper = $rendererHelper; $this->wrapper = $wrapper; diff --git a/lib/Form/BlockStylesRenderer.php b/lib/Form/BlockStylesRenderer.php index 82b4c35826..6df6d1b653 100644 --- a/lib/Form/BlockStylesRenderer.php +++ b/lib/Form/BlockStylesRenderer.php @@ -9,7 +9,7 @@ class BlockStylesRenderer { private $wp; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Form/BlockWrapperRenderer.php b/lib/Form/BlockWrapperRenderer.php index a33f464236..55fa51abbf 100644 --- a/lib/Form/BlockWrapperRenderer.php +++ b/lib/Form/BlockWrapperRenderer.php @@ -9,7 +9,7 @@ class BlockWrapperRenderer { private $wp; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Form/FormHtmlSanitizer.php b/lib/Form/FormHtmlSanitizer.php index fde0275c91..5875053831 100644 --- a/lib/Form/FormHtmlSanitizer.php +++ b/lib/Form/FormHtmlSanitizer.php @@ -45,7 +45,7 @@ class FormHtmlSanitizer { ]; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Form/PreviewWidget.php b/lib/Form/PreviewWidget.php index 2645cefc5a..bd89e925f4 100644 --- a/lib/Form/PreviewWidget.php +++ b/lib/Form/PreviewWidget.php @@ -8,7 +8,7 @@ class PreviewWidget extends \WP_Widget { private $formHtml; public function __construct( - $formHtml + $formHtml ) { $this->formHtml = $formHtml; parent::__construct( diff --git a/lib/Form/Util/CustomFonts.php b/lib/Form/Util/CustomFonts.php index 722ef1556c..00631b2a38 100644 --- a/lib/Form/Util/CustomFonts.php +++ b/lib/Form/Util/CustomFonts.php @@ -75,7 +75,7 @@ class CustomFonts { private $wp; public function __construct( - Functions $wp + Functions $wp ) { $this->wp = $wp; } diff --git a/lib/Form/Util/FieldNameObfuscator.php b/lib/Form/Util/FieldNameObfuscator.php index dafe311571..5978ecd82b 100644 --- a/lib/Form/Util/FieldNameObfuscator.php +++ b/lib/Form/Util/FieldNameObfuscator.php @@ -13,7 +13,7 @@ class FieldNameObfuscator { private $wp; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Helpscout/Beacon.php b/lib/Helpscout/Beacon.php index f67a31d5a7..1959ece7ba 100644 --- a/lib/Helpscout/Beacon.php +++ b/lib/Helpscout/Beacon.php @@ -21,9 +21,9 @@ class Beacon { private $subscribersFeature; public function __construct( - SettingsController $settings, - WPFunctions $wp, - SubscribersFeature $subscribersFeature + SettingsController $settings, + WPFunctions $wp, + SubscribersFeature $subscribersFeature ) { $this->settings = $settings; $this->wp = $wp; diff --git a/lib/Listing/BulkActionController.php b/lib/Listing/BulkActionController.php index 774725d512..1e771f1a5f 100644 --- a/lib/Listing/BulkActionController.php +++ b/lib/Listing/BulkActionController.php @@ -10,8 +10,8 @@ class BulkActionController { private $handler; public function __construct( - BulkActionFactory $factory, - Handler $handler + BulkActionFactory $factory, + Handler $handler ) { $this->factory = $factory; $this->handler = $handler; diff --git a/lib/Listing/ListingRepository.php b/lib/Listing/ListingRepository.php index 14db0b6984..3389d119c9 100644 --- a/lib/Listing/ListingRepository.php +++ b/lib/Listing/ListingRepository.php @@ -11,7 +11,7 @@ abstract class ListingRepository { protected $queryBuilder; public function __construct( - EntityManager $entityManager + EntityManager $entityManager ) { $this->queryBuilder = $entityManager->createQueryBuilder(); } diff --git a/lib/Listing/PageLimit.php b/lib/Listing/PageLimit.php index e618ab877c..2adc0d3ae1 100644 --- a/lib/Listing/PageLimit.php +++ b/lib/Listing/PageLimit.php @@ -11,7 +11,7 @@ class PageLimit { private $wp; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Logging/LoggerFactory.php b/lib/Logging/LoggerFactory.php index f76bb1ee5b..87e8840c5c 100644 --- a/lib/Logging/LoggerFactory.php +++ b/lib/Logging/LoggerFactory.php @@ -42,8 +42,8 @@ class LoggerFactory { private $logRepository; public function __construct( - LogRepository $logRepository, - SettingsController $settings + LogRepository $logRepository, + SettingsController $settings ) { $this->settings = $settings; $this->logRepository = $logRepository; diff --git a/lib/Mailer/Mailer.php b/lib/Mailer/Mailer.php index 9316b27dea..ca743e4a17 100644 --- a/lib/Mailer/Mailer.php +++ b/lib/Mailer/Mailer.php @@ -38,8 +38,8 @@ class Mailer { const METHOD_SMTP = 'SMTP'; public function __construct( - SettingsController $settings = null, - WPFunctions $wp = null + SettingsController $settings = null, + WPFunctions $wp = null ) { if (!$settings) { $settings = SettingsController::getInstance(); diff --git a/lib/Mailer/MailerError.php b/lib/Mailer/MailerError.php index 903a661e7a..9345a6f5bb 100644 --- a/lib/Mailer/MailerError.php +++ b/lib/Mailer/MailerError.php @@ -40,11 +40,11 @@ class MailerError { * @param array $subscribersErrors */ public function __construct( - $operation, - $level, - $message = null, - $retryInterval = null, - array $subscribersErrors = [] + $operation, + $level, + $message = null, + $retryInterval = null, + array $subscribersErrors = [] ) { $this->operation = $operation; $this->level = $level; diff --git a/lib/Mailer/Methods/Common/BlacklistCheck.php b/lib/Mailer/Methods/Common/BlacklistCheck.php index f316de7b74..69e532e80e 100644 --- a/lib/Mailer/Methods/Common/BlacklistCheck.php +++ b/lib/Mailer/Methods/Common/BlacklistCheck.php @@ -9,7 +9,7 @@ class BlacklistCheck { private $blacklist; public function __construct( - Blacklist $blacklist = null + Blacklist $blacklist = null ) { if (is_null($blacklist)) { $blacklist = new Blacklist(); diff --git a/lib/Mailer/Methods/MailPoet.php b/lib/Mailer/Methods/MailPoet.php index d628a0cd5e..83014fad17 100644 --- a/lib/Mailer/Methods/MailPoet.php +++ b/lib/Mailer/Methods/MailPoet.php @@ -27,11 +27,11 @@ class MailPoet { private $blacklist; public function __construct( - $apiKey, - $sender, - $replyTo, - MailPoetMapper $errorMapper, - AuthorizedEmailsController $authorizedEmailsController + $apiKey, + $sender, + $replyTo, + MailPoetMapper $errorMapper, + AuthorizedEmailsController $authorizedEmailsController ) { $this->api = new API($apiKey); $this->sender = $sender; diff --git a/lib/Mailer/Methods/PHPMail.php b/lib/Mailer/Methods/PHPMail.php index ce992f40a9..7e8d0cbbd3 100644 --- a/lib/Mailer/Methods/PHPMail.php +++ b/lib/Mailer/Methods/PHPMail.php @@ -22,10 +22,10 @@ class PHPMail { private $blacklist; public function __construct( - $sender, - $replyTo, - $returnPath, - PHPMailMapper $errorMapper + $sender, + $replyTo, + $returnPath, + PHPMailMapper $errorMapper ) { $this->sender = $sender; $this->replyTo = $replyTo; diff --git a/lib/Mailer/Methods/SendGrid.php b/lib/Mailer/Methods/SendGrid.php index 67ff133c30..49b6743687 100644 --- a/lib/Mailer/Methods/SendGrid.php +++ b/lib/Mailer/Methods/SendGrid.php @@ -22,10 +22,10 @@ class SendGrid { private $wp; public function __construct( - $apiKey, - $sender, - $replyTo, - SendGridMapper $errorMapper + $apiKey, + $sender, + $replyTo, + SendGridMapper $errorMapper ) { $this->apiKey = $apiKey; $this->sender = $sender; diff --git a/lib/Mailer/SubscriberError.php b/lib/Mailer/SubscriberError.php index 8d13db41a4..eb25491aff 100644 --- a/lib/Mailer/SubscriberError.php +++ b/lib/Mailer/SubscriberError.php @@ -15,8 +15,8 @@ class SubscriberError { * @param string $message|null */ public function __construct( - $email, - $message = null + $email, + $message = null ) { $this->email = $email; $this->message = $message; diff --git a/lib/Newsletter/ApiDataSanitizer.php b/lib/Newsletter/ApiDataSanitizer.php index 6c5bf5aaf0..0425530e0c 100644 --- a/lib/Newsletter/ApiDataSanitizer.php +++ b/lib/Newsletter/ApiDataSanitizer.php @@ -16,7 +16,7 @@ class ApiDataSanitizer { ]; public function __construct( - NewsletterHtmlSanitizer $htmlSanitizer + NewsletterHtmlSanitizer $htmlSanitizer ) { $this->htmlSanitizer = $htmlSanitizer; } diff --git a/lib/Newsletter/Editor/PostContentManager.php b/lib/Newsletter/Editor/PostContentManager.php index 4a3e8c991a..4a87dd1564 100644 --- a/lib/Newsletter/Editor/PostContentManager.php +++ b/lib/Newsletter/Editor/PostContentManager.php @@ -14,7 +14,7 @@ class PostContentManager { private $woocommerceHelper; public function __construct( - WooCommerceHelper $woocommerceHelper = null + WooCommerceHelper $woocommerceHelper = null ) { $wp = new WPFunctions; $this->maxExcerptLength = $wp->applyFilters('mailpoet_newsletter_post_excerpt_length', $this->maxExcerptLength); diff --git a/lib/Newsletter/Editor/PostListTransformer.php b/lib/Newsletter/Editor/PostListTransformer.php index bd9aa280a8..d6c203d6a4 100644 --- a/lib/Newsletter/Editor/PostListTransformer.php +++ b/lib/Newsletter/Editor/PostListTransformer.php @@ -8,7 +8,7 @@ class PostListTransformer { private $transformer; public function __construct( - $args + $args ) { $this->args = $args; $this->transformer = new PostTransformer($args); diff --git a/lib/Newsletter/Editor/PostTransformer.php b/lib/Newsletter/Editor/PostTransformer.php index 299d883819..9130a1ffd3 100644 --- a/lib/Newsletter/Editor/PostTransformer.php +++ b/lib/Newsletter/Editor/PostTransformer.php @@ -14,8 +14,8 @@ class PostTransformer { private $imagePosition; public function __construct( - $args, - PostTransformerContentsExtractor $extractor = null + $args, + PostTransformerContentsExtractor $extractor = null ) { $this->args = $args; $this->withLayout = isset($args['withLayout']) ? (bool)filter_var($args['withLayout'], FILTER_VALIDATE_BOOLEAN) : false; diff --git a/lib/Newsletter/Editor/PostTransformerContentsExtractor.php b/lib/Newsletter/Editor/PostTransformerContentsExtractor.php index e89c9f290c..e19535714f 100644 --- a/lib/Newsletter/Editor/PostTransformerContentsExtractor.php +++ b/lib/Newsletter/Editor/PostTransformerContentsExtractor.php @@ -17,7 +17,7 @@ class PostTransformerContentsExtractor { private $woocommerceHelper; public function __construct( - $args + $args ) { $this->args = $args; $this->wp = new WPFunctions(); diff --git a/lib/Newsletter/Editor/TitleListTransformer.php b/lib/Newsletter/Editor/TitleListTransformer.php index d8667330b5..dea9a73ef8 100644 --- a/lib/Newsletter/Editor/TitleListTransformer.php +++ b/lib/Newsletter/Editor/TitleListTransformer.php @@ -9,7 +9,7 @@ class TitleListTransformer { private $args; public function __construct( - $args + $args ) { $this->args = $args; } diff --git a/lib/Newsletter/Editor/Transformer.php b/lib/Newsletter/Editor/Transformer.php index 0e87e7fc0c..e01bd92361 100644 --- a/lib/Newsletter/Editor/Transformer.php +++ b/lib/Newsletter/Editor/Transformer.php @@ -7,7 +7,7 @@ class Transformer { private $transformer; public function __construct( - $args + $args ) { $titleListOnly = $args['displayType'] === 'titleOnly' && $args['titleFormat'] === 'ul'; diff --git a/lib/Newsletter/Links/Links.php b/lib/Newsletter/Links/Links.php index ca4502f889..e9f88ca1c8 100644 --- a/lib/Newsletter/Links/Links.php +++ b/lib/Newsletter/Links/Links.php @@ -28,8 +28,8 @@ class Links { private $subscribersRepository; public function __construct( - LinkTokens $linkTokens, - SubscribersRepository $subscribersRepository + LinkTokens $linkTokens, + SubscribersRepository $subscribersRepository ) { $this->linkTokens = $linkTokens; $this->subscribersRepository = $subscribersRepository; diff --git a/lib/Newsletter/NewsletterHtmlSanitizer.php b/lib/Newsletter/NewsletterHtmlSanitizer.php index dc7ec4b8d1..14ddcbad16 100644 --- a/lib/Newsletter/NewsletterHtmlSanitizer.php +++ b/lib/Newsletter/NewsletterHtmlSanitizer.php @@ -87,7 +87,7 @@ class NewsletterHtmlSanitizer { ]; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Newsletter/NewslettersRepository.php b/lib/Newsletter/NewslettersRepository.php index f42a029797..1091bd8f0a 100644 --- a/lib/Newsletter/NewslettersRepository.php +++ b/lib/Newsletter/NewslettersRepository.php @@ -36,7 +36,7 @@ class NewslettersRepository extends Repository { private $loggerFactory; public function __construct( - EntityManager $entityManager + EntityManager $entityManager ) { parent::__construct($entityManager); $this->loggerFactory = LoggerFactory::getInstance(); diff --git a/lib/Newsletter/Renderer/Blocks/Placeholder.php b/lib/Newsletter/Renderer/Blocks/Placeholder.php index 8facdb24fe..6d4d10f091 100644 --- a/lib/Newsletter/Renderer/Blocks/Placeholder.php +++ b/lib/Newsletter/Renderer/Blocks/Placeholder.php @@ -9,7 +9,7 @@ class Placeholder { private $wp; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Newsletter/Shortcodes/Categories/Newsletter.php b/lib/Newsletter/Shortcodes/Categories/Newsletter.php index 79d5b4e8b6..6441b66338 100644 --- a/lib/Newsletter/Shortcodes/Categories/Newsletter.php +++ b/lib/Newsletter/Shortcodes/Categories/Newsletter.php @@ -14,7 +14,7 @@ class Newsletter implements CategoryInterface { private $newslettersRepository; public function __construct( - NewslettersRepository $newslettersRepository + NewslettersRepository $newslettersRepository ) { $this->newslettersRepository = $newslettersRepository; } diff --git a/lib/Newsletter/Shortcodes/ShortcodesHelper.php b/lib/Newsletter/Shortcodes/ShortcodesHelper.php index ba34841d36..d94a4589d1 100644 --- a/lib/Newsletter/Shortcodes/ShortcodesHelper.php +++ b/lib/Newsletter/Shortcodes/ShortcodesHelper.php @@ -10,7 +10,7 @@ class ShortcodesHelper { private $customFieldsRepository; public function __construct( - CustomFieldsRepository $customFieldsRepository + CustomFieldsRepository $customFieldsRepository ) { $this->customFieldsRepository = $customFieldsRepository; } diff --git a/lib/Newsletter/Statistics/NewsletterStatisticsRepository.php b/lib/Newsletter/Statistics/NewsletterStatisticsRepository.php index 409ef62cca..69deb8bf6a 100644 --- a/lib/Newsletter/Statistics/NewsletterStatisticsRepository.php +++ b/lib/Newsletter/Statistics/NewsletterStatisticsRepository.php @@ -25,8 +25,8 @@ class NewsletterStatisticsRepository extends Repository { private $wcHelper; public function __construct( - EntityManager $entityManager, - WCHelper $wcHelper + EntityManager $entityManager, + WCHelper $wcHelper ) { parent::__construct($entityManager); $this->wcHelper = $wcHelper; diff --git a/lib/Newsletter/Statistics/WooCommerceRevenue.php b/lib/Newsletter/Statistics/WooCommerceRevenue.php index 929d039001..21e5254760 100644 --- a/lib/Newsletter/Statistics/WooCommerceRevenue.php +++ b/lib/Newsletter/Statistics/WooCommerceRevenue.php @@ -19,10 +19,10 @@ class WooCommerceRevenue { private $wooCommerceHelper; public function __construct( - $currency, - $value, - $ordersCount, - Helper $wooCommerceHelper + $currency, + $value, + $ordersCount, + Helper $wooCommerceHelper ) { $this->currency = $currency; $this->value = $value; diff --git a/lib/Newsletter/Url.php b/lib/Newsletter/Url.php index 00a1b97ec3..f4b17d1b8a 100644 --- a/lib/Newsletter/Url.php +++ b/lib/Newsletter/Url.php @@ -17,8 +17,8 @@ class Url { private $subscribersRepository; public function __construct( - LinkTokens $linkTokens, - SubscribersRepository $subscribersRepository + LinkTokens $linkTokens, + SubscribersRepository $subscribersRepository ) { $this->linkTokens = $linkTokens; $this->subscribersRepository = $subscribersRepository; diff --git a/lib/Referrals/ReferralDetector.php b/lib/Referrals/ReferralDetector.php index 4a5f09a48a..896c680b93 100644 --- a/lib/Referrals/ReferralDetector.php +++ b/lib/Referrals/ReferralDetector.php @@ -16,8 +16,8 @@ class ReferralDetector { private $settings; public function __construct( - WPFunctions $wp, - SettingsController $settings + WPFunctions $wp, + SettingsController $settings ) { $this->wp = $wp; $this->settings = $settings; diff --git a/lib/Referrals/UrlDecorator.php b/lib/Referrals/UrlDecorator.php index ee30c446a7..27b54aa780 100644 --- a/lib/Referrals/UrlDecorator.php +++ b/lib/Referrals/UrlDecorator.php @@ -14,8 +14,8 @@ class UrlDecorator { private $settings; public function __construct( - WPFunctions $wp, - SettingsController $settings + WPFunctions $wp, + SettingsController $settings ) { $this->wp = $wp; $this->settings = $settings; diff --git a/lib/Router/Endpoints/CronDaemon.php b/lib/Router/Endpoints/CronDaemon.php index d218127ffa..f246a5ccc6 100644 --- a/lib/Router/Endpoints/CronDaemon.php +++ b/lib/Router/Endpoints/CronDaemon.php @@ -28,8 +28,8 @@ class CronDaemon { private $cronHelper; public function __construct( - DaemonHttpRunner $daemonRunner, - CronHelper $cronHelper + DaemonHttpRunner $daemonRunner, + CronHelper $cronHelper ) { $this->daemonRunner = $daemonRunner; $this->cronHelper = $cronHelper; diff --git a/lib/Router/Endpoints/Subscription.php b/lib/Router/Endpoints/Subscription.php index db10bc3884..879fe64a23 100644 --- a/lib/Router/Endpoints/Subscription.php +++ b/lib/Router/Endpoints/Subscription.php @@ -36,9 +36,9 @@ class Subscription { private $captcha; public function __construct( - UserSubscription\Pages $subscriptionPages, - WPFunctions $wp, - UserSubscription\Captcha $captcha + UserSubscription\Pages $subscriptionPages, + WPFunctions $wp, + UserSubscription\Captcha $captcha ) { $this->subscriptionPages = $subscriptionPages; $this->wp = $wp; diff --git a/lib/Router/Endpoints/ViewInBrowser.php b/lib/Router/Endpoints/ViewInBrowser.php index 7c4f6aea14..3c73acf611 100644 --- a/lib/Router/Endpoints/ViewInBrowser.php +++ b/lib/Router/Endpoints/ViewInBrowser.php @@ -19,7 +19,7 @@ class ViewInBrowser { private $viewInBrowserController; public function __construct( - ViewInBrowserController $viewInBrowserController + ViewInBrowserController $viewInBrowserController ) { $this->viewInBrowserController = $viewInBrowserController; } diff --git a/lib/Router/Router.php b/lib/Router/Router.php index 612386edb6..57715fe969 100644 --- a/lib/Router/Router.php +++ b/lib/Router/Router.php @@ -21,9 +21,9 @@ class Router { const RESPONE_FORBIDDEN = 403; public function __construct( - AccessControl $accessControl, - ContainerInterface $container, - $apiData = false + AccessControl $accessControl, + ContainerInterface $container, + $apiData = false ) { $apiData = ($apiData) ? $apiData : $_GET; $this->apiRequest = is_array($apiData) && array_key_exists(self::NAME, $apiData); diff --git a/lib/Segments/DynamicSegments/Filters/EmailAction.php b/lib/Segments/DynamicSegments/Filters/EmailAction.php index ca4430a9ae..c3d28e68f8 100644 --- a/lib/Segments/DynamicSegments/Filters/EmailAction.php +++ b/lib/Segments/DynamicSegments/Filters/EmailAction.php @@ -42,7 +42,7 @@ class EmailAction implements Filter { private $entityManager; public function __construct( - EntityManager $entityManager + EntityManager $entityManager ) { $this->entityManager = $entityManager; } diff --git a/lib/Segments/DynamicSegments/Filters/EmailOpensAbsoluteCountAction.php b/lib/Segments/DynamicSegments/Filters/EmailOpensAbsoluteCountAction.php index 91b026d20a..b7f1082acf 100644 --- a/lib/Segments/DynamicSegments/Filters/EmailOpensAbsoluteCountAction.php +++ b/lib/Segments/DynamicSegments/Filters/EmailOpensAbsoluteCountAction.php @@ -19,7 +19,7 @@ class EmailOpensAbsoluteCountAction implements Filter { private $entityManager; public function __construct( - EntityManager $entityManager + EntityManager $entityManager ) { $this->entityManager = $entityManager; } diff --git a/lib/Segments/DynamicSegments/Filters/MailPoetCustomFields.php b/lib/Segments/DynamicSegments/Filters/MailPoetCustomFields.php index f53664940e..3288d1221b 100644 --- a/lib/Segments/DynamicSegments/Filters/MailPoetCustomFields.php +++ b/lib/Segments/DynamicSegments/Filters/MailPoetCustomFields.php @@ -18,7 +18,7 @@ class MailPoetCustomFields implements Filter { private $entityManager; public function __construct( - EntityManager $entityManager + EntityManager $entityManager ) { $this->entityManager = $entityManager; } diff --git a/lib/Segments/DynamicSegments/Filters/UserRole.php b/lib/Segments/DynamicSegments/Filters/UserRole.php index 9a101151e9..c1c0c58c85 100644 --- a/lib/Segments/DynamicSegments/Filters/UserRole.php +++ b/lib/Segments/DynamicSegments/Filters/UserRole.php @@ -16,7 +16,7 @@ class UserRole implements Filter { private $entityManager; public function __construct( - EntityManager $entityManager + EntityManager $entityManager ) { $this->entityManager = $entityManager; } diff --git a/lib/Segments/DynamicSegments/Filters/WooCommerceCountry.php b/lib/Segments/DynamicSegments/Filters/WooCommerceCountry.php index 53ead1ec85..07314a1d26 100644 --- a/lib/Segments/DynamicSegments/Filters/WooCommerceCountry.php +++ b/lib/Segments/DynamicSegments/Filters/WooCommerceCountry.php @@ -15,7 +15,7 @@ class WooCommerceCountry implements Filter { private $entityManager; public function __construct( - EntityManager $entityManager + EntityManager $entityManager ) { $this->entityManager = $entityManager; } diff --git a/lib/Segments/DynamicSegments/Filters/WooCommerceNumberOfOrders.php b/lib/Segments/DynamicSegments/Filters/WooCommerceNumberOfOrders.php index 260bc6fd86..3b68076505 100644 --- a/lib/Segments/DynamicSegments/Filters/WooCommerceNumberOfOrders.php +++ b/lib/Segments/DynamicSegments/Filters/WooCommerceNumberOfOrders.php @@ -16,7 +16,7 @@ class WooCommerceNumberOfOrders implements Filter { private $entityManager; public function __construct( - EntityManager $entityManager + EntityManager $entityManager ) { $this->entityManager = $entityManager; } diff --git a/lib/Segments/DynamicSegments/Filters/WooCommerceProduct.php b/lib/Segments/DynamicSegments/Filters/WooCommerceProduct.php index 51436f862e..e6af98ca30 100644 --- a/lib/Segments/DynamicSegments/Filters/WooCommerceProduct.php +++ b/lib/Segments/DynamicSegments/Filters/WooCommerceProduct.php @@ -15,7 +15,7 @@ class WooCommerceProduct implements Filter { private $entityManager; public function __construct( - EntityManager $entityManager + EntityManager $entityManager ) { $this->entityManager = $entityManager; } diff --git a/lib/Segments/DynamicSegments/Filters/WooCommerceSubscription.php b/lib/Segments/DynamicSegments/Filters/WooCommerceSubscription.php index 7a0fc3581e..39a040ed44 100644 --- a/lib/Segments/DynamicSegments/Filters/WooCommerceSubscription.php +++ b/lib/Segments/DynamicSegments/Filters/WooCommerceSubscription.php @@ -15,7 +15,7 @@ class WooCommerceSubscription implements Filter { private $entityManager; public function __construct( - EntityManager $entityManager + EntityManager $entityManager ) { $this->entityManager = $entityManager; } diff --git a/lib/Segments/DynamicSegments/Filters/WooCommerceTotalSpent.php b/lib/Segments/DynamicSegments/Filters/WooCommerceTotalSpent.php index 1af8ab17cd..c5354dd2fb 100644 --- a/lib/Segments/DynamicSegments/Filters/WooCommerceTotalSpent.php +++ b/lib/Segments/DynamicSegments/Filters/WooCommerceTotalSpent.php @@ -16,7 +16,7 @@ class WooCommerceTotalSpent implements Filter { private $entityManager; public function __construct( - EntityManager $entityManager + EntityManager $entityManager ) { $this->entityManager = $entityManager; } diff --git a/lib/Segments/SegmentDependencyValidator.php b/lib/Segments/SegmentDependencyValidator.php index 19e976f310..48fecade3b 100644 --- a/lib/Segments/SegmentDependencyValidator.php +++ b/lib/Segments/SegmentDependencyValidator.php @@ -32,7 +32,7 @@ class SegmentDependencyValidator { private $wp; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Segments/WP.php b/lib/Segments/WP.php index b04f17acfd..1beff220f2 100644 --- a/lib/Segments/WP.php +++ b/lib/Segments/WP.php @@ -31,9 +31,9 @@ class WP { private $wooHelper; public function __construct( - WPFunctions $wp, - WelcomeScheduler $welcomeScheduler, - WooCommerceHelper $wooHelper + WPFunctions $wp, + WelcomeScheduler $welcomeScheduler, + WooCommerceHelper $wooHelper ) { $this->wp = $wp; $this->welcomeScheduler = $welcomeScheduler; diff --git a/lib/Services/Bridge.php b/lib/Services/Bridge.php index dc1b584c1f..d07839b504 100644 --- a/lib/Services/Bridge.php +++ b/lib/Services/Bridge.php @@ -41,8 +41,8 @@ class Bridge { private $subscribersFeature; public function __construct( - SettingsController $settingsController = null, - SubscribersFeature $subscribersFeature = null + SettingsController $settingsController = null, + SubscribersFeature $subscribersFeature = null ) { if ($settingsController === null) { $settingsController = SettingsController::getInstance(); diff --git a/lib/Services/Bridge/API.php b/lib/Services/Bridge/API.php index e62f3c268a..3e58126b07 100644 --- a/lib/Services/Bridge/API.php +++ b/lib/Services/Bridge/API.php @@ -36,8 +36,8 @@ class API { public $urlAuthorizedEmailAddresses = 'https://bridge.mailpoet.com/api/v0/authorized_email_addresses'; public function __construct( - $apiKey, - $wp = null + $apiKey, + $wp = null ) { $this->setKey($apiKey); if (is_null($wp)) { diff --git a/lib/Services/Release/API.php b/lib/Services/Release/API.php index fb28d69057..a2d0481df2 100644 --- a/lib/Services/Release/API.php +++ b/lib/Services/Release/API.php @@ -10,7 +10,7 @@ class API { public $urlProducts = 'https://release.mailpoet.com/products/'; public function __construct( - $apiKey + $apiKey ) { $this->setKey($apiKey); $this->wp = new WPFunctions(); diff --git a/lib/Settings/UserFlagsController.php b/lib/Settings/UserFlagsController.php index 467a5c4151..fccbcbdd16 100644 --- a/lib/Settings/UserFlagsController.php +++ b/lib/Settings/UserFlagsController.php @@ -17,7 +17,7 @@ class UserFlagsController { private $userFlagsRepository; public function __construct( - UserFlagsRepository $userFlagsRepository + UserFlagsRepository $userFlagsRepository ) { $this->defaults = [ 'last_announcement_seen' => false, diff --git a/lib/Statistics/GATracking.php b/lib/Statistics/GATracking.php index faa9b87d96..8b42072f8d 100644 --- a/lib/Statistics/GATracking.php +++ b/lib/Statistics/GATracking.php @@ -16,7 +16,7 @@ class GATracking { private $newsletterLinks; public function __construct( - NewsletterLinks $newsletterLinks + NewsletterLinks $newsletterLinks ) { $this->secondLevelDomainNames = new SecondLevelDomainNames(); $this->newsletterLinks = $newsletterLinks; diff --git a/lib/Statistics/Track/WooCommercePurchases.php b/lib/Statistics/Track/WooCommercePurchases.php index 357f4385f9..497d3f40ce 100644 --- a/lib/Statistics/Track/WooCommercePurchases.php +++ b/lib/Statistics/Track/WooCommercePurchases.php @@ -19,8 +19,8 @@ class WooCommercePurchases { private $cookies; public function __construct( - Helper $woocommerceHelper, - Cookies $cookies + Helper $woocommerceHelper, + Cookies $cookies ) { $this->woocommerceHelper = $woocommerceHelper; $this->cookies = $cookies; diff --git a/lib/Subscribers/ImportExport/Import/MailChimp.php b/lib/Subscribers/ImportExport/Import/MailChimp.php index c9af70c5bd..f01851132d 100644 --- a/lib/Subscribers/ImportExport/Import/MailChimp.php +++ b/lib/Subscribers/ImportExport/Import/MailChimp.php @@ -20,7 +20,7 @@ class MailChimp { private $mapper; public function __construct( - $apiKey + $apiKey ) { $this->apiKey = $this->getAPIKey($apiKey); $this->maxPostSize = (int)Helpers::getMaxPostSize('bytes'); diff --git a/lib/Subscribers/ImportExport/ImportExportFactory.php b/lib/Subscribers/ImportExport/ImportExportFactory.php index 6e3a6fbaab..cbadc57143 100644 --- a/lib/Subscribers/ImportExport/ImportExportFactory.php +++ b/lib/Subscribers/ImportExport/ImportExportFactory.php @@ -19,7 +19,7 @@ class ImportExportFactory { private $segmentsListRepository; public function __construct( - $action = null + $action = null ) { $this->action = $action; $this->segmentsListRepository = ContainerWrapper::getInstance()->get(SegmentsSimpleListRepository::class); @@ -96,7 +96,8 @@ class ImportExportFactory { public function formatFieldsForSelect2( $subscriberFields, - $subscriberCustomFields) { + $subscriberCustomFields + ) { $actions = ($this->action === 'import') ? [ [ diff --git a/lib/Subscribers/ImportExport/ImportExportRepository.php b/lib/Subscribers/ImportExport/ImportExportRepository.php index 464aba3fc9..108204fe39 100644 --- a/lib/Subscribers/ImportExport/ImportExportRepository.php +++ b/lib/Subscribers/ImportExport/ImportExportRepository.php @@ -50,8 +50,8 @@ class ImportExportRepository { private $filterHandler; public function __construct( - EntityManager $entityManager, - FilterHandler $filterHandler + EntityManager $entityManager, + FilterHandler $filterHandler ) { $this->entityManager = $entityManager; $this->filterHandler = $filterHandler; diff --git a/lib/Subscribers/ImportExport/PersonalDataExporters/NewsletterStatsBaseExporter.php b/lib/Subscribers/ImportExport/PersonalDataExporters/NewsletterStatsBaseExporter.php index 62fc8e4f8c..cdb8c9e733 100644 --- a/lib/Subscribers/ImportExport/PersonalDataExporters/NewsletterStatsBaseExporter.php +++ b/lib/Subscribers/ImportExport/PersonalDataExporters/NewsletterStatsBaseExporter.php @@ -15,7 +15,7 @@ abstract class NewsletterStatsBaseExporter { protected $subscriberRepository; public function __construct( - SubscribersRepository $subscribersRepository + SubscribersRepository $subscribersRepository ) { $this->subscriberRepository = $subscribersRepository; } diff --git a/lib/Subscribers/ImportExport/PersonalDataExporters/NewslettersExporter.php b/lib/Subscribers/ImportExport/PersonalDataExporters/NewslettersExporter.php index 38f08103f3..12a7b0c1a3 100644 --- a/lib/Subscribers/ImportExport/PersonalDataExporters/NewslettersExporter.php +++ b/lib/Subscribers/ImportExport/PersonalDataExporters/NewslettersExporter.php @@ -16,7 +16,7 @@ class NewslettersExporter { private $newsletterUrl; public function __construct( - NewsletterUrl $newsletterUrl + NewsletterUrl $newsletterUrl ) { $this->newsletterUrl = $newsletterUrl; } diff --git a/lib/Subscribers/InactiveSubscribersController.php b/lib/Subscribers/InactiveSubscribersController.php index 123249a9ce..657a89536e 100644 --- a/lib/Subscribers/InactiveSubscribersController.php +++ b/lib/Subscribers/InactiveSubscribersController.php @@ -20,7 +20,7 @@ class InactiveSubscribersController { private $settingsRepository; public function __construct( - SettingsRepository $settingsRepository + SettingsRepository $settingsRepository ) { $this->settingsRepository = $settingsRepository; } diff --git a/lib/Subscribers/LinkTokens.php b/lib/Subscribers/LinkTokens.php index 2765261678..ba13974e0b 100644 --- a/lib/Subscribers/LinkTokens.php +++ b/lib/Subscribers/LinkTokens.php @@ -11,7 +11,7 @@ class LinkTokens { private $subscribersRepository; public function __construct( - SubscribersRepository $subscribersRepository + SubscribersRepository $subscribersRepository ) { $this->subscribersRepository = $subscribersRepository; } diff --git a/lib/Subscribers/NewSubscriberNotificationMailer.php b/lib/Subscribers/NewSubscriberNotificationMailer.php index 9027d35edf..fd39d41cf3 100644 --- a/lib/Subscribers/NewSubscriberNotificationMailer.php +++ b/lib/Subscribers/NewSubscriberNotificationMailer.php @@ -27,9 +27,9 @@ class NewSubscriberNotificationMailer { private $mailerMetaInfo; public function __construct( - Mailer $mailer, - Renderer $renderer, - SettingsController $settings + Mailer $mailer, + Renderer $renderer, + SettingsController $settings ) { $this->mailer = $mailer; $this->renderer = $renderer; diff --git a/lib/Subscribers/RequiredCustomFieldValidator.php b/lib/Subscribers/RequiredCustomFieldValidator.php index 19846479e0..7814f4626b 100644 --- a/lib/Subscribers/RequiredCustomFieldValidator.php +++ b/lib/Subscribers/RequiredCustomFieldValidator.php @@ -11,7 +11,7 @@ class RequiredCustomFieldValidator { private $customFieldRepository; public function __construct( - CustomFieldsRepository $customFieldRepository + CustomFieldsRepository $customFieldRepository ) { $this->customFieldRepository = $customFieldRepository; } diff --git a/lib/Subscribers/Statistics/SubscriberStatistics.php b/lib/Subscribers/Statistics/SubscriberStatistics.php index 7d597d7487..683cb6db5b 100644 --- a/lib/Subscribers/Statistics/SubscriberStatistics.php +++ b/lib/Subscribers/Statistics/SubscriberStatistics.php @@ -22,11 +22,11 @@ class SubscriberStatistics { private $wooCommerceRevenue; public function __construct( - $clickCount, - $openCount, - $machineOpenCount, - $totalSentCount, - $wooCommerceRevenue = null + $clickCount, + $openCount, + $machineOpenCount, + $totalSentCount, + $wooCommerceRevenue = null ) { $this->clickCount = $clickCount; $this->openCount = $openCount; diff --git a/lib/Subscribers/Statistics/SubscriberStatisticsRepository.php b/lib/Subscribers/Statistics/SubscriberStatisticsRepository.php index da2fc634d9..5ad53dafab 100644 --- a/lib/Subscribers/Statistics/SubscriberStatisticsRepository.php +++ b/lib/Subscribers/Statistics/SubscriberStatisticsRepository.php @@ -23,8 +23,8 @@ class SubscriberStatisticsRepository extends Repository { private $wcHelper; public function __construct( - EntityManager $entityManager, - WCHelper $wcHelper + EntityManager $entityManager, + WCHelper $wcHelper ) { parent::__construct($entityManager); $this->wcHelper = $wcHelper; diff --git a/lib/Subscribers/SubscribersRepository.php b/lib/Subscribers/SubscribersRepository.php index 0f3b803a17..7b2b658329 100644 --- a/lib/Subscribers/SubscribersRepository.php +++ b/lib/Subscribers/SubscribersRepository.php @@ -30,8 +30,8 @@ class SubscribersRepository extends Repository { ]; public function __construct( - EntityManager $entityManager, - WPFunctions $wp + EntityManager $entityManager, + WPFunctions $wp ) { $this->wp = $wp; parent::__construct($entityManager); diff --git a/lib/Subscription/Blacklist.php b/lib/Subscription/Blacklist.php index 01fe620129..a04229b9b6 100644 --- a/lib/Subscription/Blacklist.php +++ b/lib/Subscription/Blacklist.php @@ -20,8 +20,8 @@ class Blacklist { ]; public function __construct( - array $blacklistedEmails = null, - array $blacklistedDomains = null + array $blacklistedEmails = null, + array $blacklistedDomains = null ) { if ($blacklistedEmails) { $this->blacklistedEmails = array_fill_keys(array_map([$this, 'hash'], $blacklistedEmails), 1); diff --git a/lib/Subscription/CaptchaSession.php b/lib/Subscription/CaptchaSession.php index 96706b8cd2..bed75d3869 100644 --- a/lib/Subscription/CaptchaSession.php +++ b/lib/Subscription/CaptchaSession.php @@ -19,7 +19,7 @@ class CaptchaSession { private $id; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Subscription/Form.php b/lib/Subscription/Form.php index 269e912d19..caa379e8d3 100644 --- a/lib/Subscription/Form.php +++ b/lib/Subscription/Form.php @@ -16,8 +16,8 @@ class Form { private $urlHelper; public function __construct( - API $api, - UrlHelper $urlHelper + API $api, + UrlHelper $urlHelper ) { $this->api = $api; $this->urlHelper = $urlHelper; diff --git a/lib/Subscription/SubscriptionUrlFactory.php b/lib/Subscription/SubscriptionUrlFactory.php index 65c6a0cbbf..53b83a55a6 100644 --- a/lib/Subscription/SubscriptionUrlFactory.php +++ b/lib/Subscription/SubscriptionUrlFactory.php @@ -26,9 +26,9 @@ class SubscriptionUrlFactory { private $linkTokens; public function __construct( - WPFunctions $wp, - SettingsController $settings, - LinkTokens $linkTokens + WPFunctions $wp, + SettingsController $settings, + LinkTokens $linkTokens ) { $this->wp = $wp; $this->settings = $settings; diff --git a/lib/Subscription/Throttling.php b/lib/Subscription/Throttling.php index 79cdad021c..f6c9304c92 100644 --- a/lib/Subscription/Throttling.php +++ b/lib/Subscription/Throttling.php @@ -15,8 +15,8 @@ class Throttling { private $wp; public function __construct( - SubscriberIPsRepository $subscriberIPsRepository, - WPFunctions $wp + SubscriberIPsRepository $subscriberIPsRepository, + WPFunctions $wp ) { $this->wp = $wp; $this->subscriberIPsRepository = $subscriberIPsRepository; diff --git a/lib/Tasks/Sending.php b/lib/Tasks/Sending.php index 011d143f3c..badffe50f0 100644 --- a/lib/Tasks/Sending.php +++ b/lib/Tasks/Sending.php @@ -54,8 +54,8 @@ class Sending { ]; private function __construct( - ScheduledTask $task = null, - SendingQueue $queue = null + ScheduledTask $task = null, + SendingQueue $queue = null ) { if (!$task instanceof ScheduledTask) { $task = ScheduledTask::create(); diff --git a/lib/Tasks/State.php b/lib/Tasks/State.php index 0dcf0ce94e..42db00fd88 100644 --- a/lib/Tasks/State.php +++ b/lib/Tasks/State.php @@ -14,7 +14,7 @@ class State { private $newsletterUrl; public function __construct( - NewsletterUrl $newsletterUrl + NewsletterUrl $newsletterUrl ) { $this->newsletterUrl = $newsletterUrl; } @@ -55,7 +55,8 @@ class State { ScheduledTask::STATUS_SCHEDULED, ScheduledTask::VIRTUAL_STATUS_RUNNING, ], - $limit = Scheduler::TASK_BATCH_SIZE) { + $limit = Scheduler::TASK_BATCH_SIZE + ) { $tasks = []; foreach ($statuses as $status) { $query = ScheduledTask::orderByDesc('id') diff --git a/lib/Tasks/Subscribers.php b/lib/Tasks/Subscribers.php index f160d4affc..e9fe03c4bf 100644 --- a/lib/Tasks/Subscribers.php +++ b/lib/Tasks/Subscribers.php @@ -9,7 +9,7 @@ class Subscribers { private $task; public function __construct( - ScheduledTask $task + ScheduledTask $task ) { $this->task = $task; } diff --git a/lib/Tasks/Subscribers/BatchIterator.php b/lib/Tasks/Subscribers/BatchIterator.php index 6569e13451..e85737b18a 100644 --- a/lib/Tasks/Subscribers/BatchIterator.php +++ b/lib/Tasks/Subscribers/BatchIterator.php @@ -14,8 +14,8 @@ class BatchIterator implements \Iterator, \Countable { private $batchLastId; public function __construct( - $taskId, - $batchSize + $taskId, + $batchSize ) { if ($taskId <= 0) { throw new \Exception('Task ID must be greater than zero'); diff --git a/lib/Tracy/ApiPanel/ApiPanel.php b/lib/Tracy/ApiPanel/ApiPanel.php index a06badc57b..b389d94176 100644 --- a/lib/Tracy/ApiPanel/ApiPanel.php +++ b/lib/Tracy/ApiPanel/ApiPanel.php @@ -24,9 +24,9 @@ class ApiPanel implements IBarPanel { protected $endpointReflection; public function __construct( - APIEndpoint $endpoint, - $requestMethod, - $requestData + APIEndpoint $endpoint, + $requestMethod, + $requestData ) { $this->endpoint = $endpoint; $this->requestMethod = $requestMethod; diff --git a/lib/Twig/I18n.php b/lib/Twig/I18n.php index 7813c56e60..8647bcc907 100644 --- a/lib/Twig/I18n.php +++ b/lib/Twig/I18n.php @@ -13,7 +13,7 @@ class I18n extends AbstractExtension { private $textDomains; public function __construct( - $textDomain + $textDomain ) { // set text domain $this->textDomains = [$textDomain, 'woocommerce']; diff --git a/lib/Util/CdnAssetUrl.php b/lib/Util/CdnAssetUrl.php index 3de2a28812..7f96d20058 100644 --- a/lib/Util/CdnAssetUrl.php +++ b/lib/Util/CdnAssetUrl.php @@ -8,7 +8,7 @@ class CdnAssetUrl { private $baseUrl; public function __construct( - string $baseUrl + string $baseUrl ) { $this->baseUrl = $baseUrl; } diff --git a/lib/Util/Installation.php b/lib/Util/Installation.php index fc7c80b4df..b010e46fc2 100644 --- a/lib/Util/Installation.php +++ b/lib/Util/Installation.php @@ -16,8 +16,8 @@ class Installation { private $wp; public function __construct( - SettingsController $settings, - WPFunctions $wp + SettingsController $settings, + WPFunctions $wp ) { $this->settings = $settings; $this->wp = $wp; diff --git a/lib/Util/License/Features/Subscribers.php b/lib/Util/License/Features/Subscribers.php index 3277a14174..186d74bebf 100644 --- a/lib/Util/License/Features/Subscribers.php +++ b/lib/Util/License/Features/Subscribers.php @@ -23,8 +23,8 @@ class Subscribers { private $subscribersRepository; public function __construct( - SettingsController $settings, - SubscribersRepository $subscribersRepository + SettingsController $settings, + SubscribersRepository $subscribersRepository ) { $this->settings = $settings; $this->subscribersRepository = $subscribersRepository; diff --git a/lib/Util/Notices/DeprecatedShortcodeNotice.php b/lib/Util/Notices/DeprecatedShortcodeNotice.php index 11d918aea1..807c11e672 100644 --- a/lib/Util/Notices/DeprecatedShortcodeNotice.php +++ b/lib/Util/Notices/DeprecatedShortcodeNotice.php @@ -17,7 +17,7 @@ class DeprecatedShortcodeNotice { private $wp; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Util/Notices/EmailWithInvalidSegmentNotice.php b/lib/Util/Notices/EmailWithInvalidSegmentNotice.php index fcfa57df11..19becab60a 100644 --- a/lib/Util/Notices/EmailWithInvalidSegmentNotice.php +++ b/lib/Util/Notices/EmailWithInvalidSegmentNotice.php @@ -13,7 +13,7 @@ class EmailWithInvalidSegmentNotice { private $wp; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/Util/Notices/HeadersAlreadySentNotice.php b/lib/Util/Notices/HeadersAlreadySentNotice.php index 6f7e333214..0179f8c67c 100644 --- a/lib/Util/Notices/HeadersAlreadySentNotice.php +++ b/lib/Util/Notices/HeadersAlreadySentNotice.php @@ -20,8 +20,8 @@ class HeadersAlreadySentNotice { private $wp; public function __construct( - SettingsController $settings, - WPFunctions $wp + SettingsController $settings, + WPFunctions $wp ) { $this->settings = $settings; $this->wp = $wp; diff --git a/lib/Util/Notices/InactiveSubscribersNotice.php b/lib/Util/Notices/InactiveSubscribersNotice.php index 13ce070979..cc93f92284 100644 --- a/lib/Util/Notices/InactiveSubscribersNotice.php +++ b/lib/Util/Notices/InactiveSubscribersNotice.php @@ -19,8 +19,8 @@ class InactiveSubscribersNotice { private $wp; public function __construct( - SettingsController $settings, - WPFunctions $wp + SettingsController $settings, + WPFunctions $wp ) { $this->settings = $settings; $this->wp = $wp; diff --git a/lib/Util/Notices/PermanentNotices.php b/lib/Util/Notices/PermanentNotices.php index 33fcd1bb51..2db167f743 100644 --- a/lib/Util/Notices/PermanentNotices.php +++ b/lib/Util/Notices/PermanentNotices.php @@ -39,7 +39,7 @@ class PermanentNotices { private $emailWithInvalidListNotice; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; $this->phpVersionWarnings = new PHPVersionWarnings(); diff --git a/lib/Util/Notices/UnauthorizedEmailInNewslettersNotice.php b/lib/Util/Notices/UnauthorizedEmailInNewslettersNotice.php index e2731d40fb..e957a91bf3 100644 --- a/lib/Util/Notices/UnauthorizedEmailInNewslettersNotice.php +++ b/lib/Util/Notices/UnauthorizedEmailInNewslettersNotice.php @@ -22,8 +22,8 @@ class UnauthorizedEmailInNewslettersNotice { private $wp; public function __construct( - SettingsController $settings, - WPFunctions $wp + SettingsController $settings, + WPFunctions $wp ) { $this->settings = $settings; $this->wp = $wp; diff --git a/lib/Util/Notices/UnauthorizedEmailNotice.php b/lib/Util/Notices/UnauthorizedEmailNotice.php index bc75ee87b8..7c5de77444 100644 --- a/lib/Util/Notices/UnauthorizedEmailNotice.php +++ b/lib/Util/Notices/UnauthorizedEmailNotice.php @@ -19,8 +19,8 @@ class UnauthorizedEmailNotice { private $wp; public function __construct( - SettingsController $settings, - WPFunctions $wp + SettingsController $settings, + WPFunctions $wp ) { $this->settings = $settings; $this->wp = $wp; diff --git a/lib/Util/ProgressBar.php b/lib/Util/ProgressBar.php index 8114b024bb..c40cf40ee0 100644 --- a/lib/Util/ProgressBar.php +++ b/lib/Util/ProgressBar.php @@ -22,7 +22,7 @@ if (!class_exists('ProgressBar', false)) { * */ public function __construct( - $progressBarId + $progressBarId ) { $filename = $progressBarId . '-progress.json'; $this->filename = Env::$tempPath . '/' . $filename; diff --git a/lib/Util/Security.php b/lib/Util/Security.php index 21eebcd515..e240c28856 100644 --- a/lib/Util/Security.php +++ b/lib/Util/Security.php @@ -20,8 +20,8 @@ class Security { private $subscribersRepository; public function __construct( - NewslettersRepository $newslettersRepository, - SubscribersRepository $subscribersRepository + NewslettersRepository $newslettersRepository, + SubscribersRepository $subscribersRepository ) { $this->newslettersRepository = $newslettersRepository; $this->subscribersRepository = $subscribersRepository; diff --git a/lib/Util/Url.php b/lib/Util/Url.php index 554d505251..0a40507ca4 100644 --- a/lib/Util/Url.php +++ b/lib/Util/Url.php @@ -9,7 +9,7 @@ class Url { private $wp; public function __construct( - WPFunctions $wp + WPFunctions $wp ) { $this->wp = $wp; } diff --git a/lib/WP/AutocompletePostListLoader.php b/lib/WP/AutocompletePostListLoader.php index 387379df0f..44c973ee2d 100644 --- a/lib/WP/AutocompletePostListLoader.php +++ b/lib/WP/AutocompletePostListLoader.php @@ -10,7 +10,7 @@ class AutocompletePostListLoader { private $wp; public function __construct( - Functions $wp + Functions $wp ) { $this->wp = $wp; } diff --git a/lib/WP/DateTime.php b/lib/WP/DateTime.php index 5492ef43f8..b8921f0e41 100644 --- a/lib/WP/DateTime.php +++ b/lib/WP/DateTime.php @@ -14,7 +14,7 @@ class DateTime { private $wp; public function __construct( - WPFunctions $wp = null + WPFunctions $wp = null ) { if ($wp === null) { $wp = new WPFunctions(); diff --git a/lib/WP/Emoji.php b/lib/WP/Emoji.php index e50f5ae3b7..03ae2244e8 100644 --- a/lib/WP/Emoji.php +++ b/lib/WP/Emoji.php @@ -9,7 +9,7 @@ class Emoji { private $wp; public function __construct( - WPFunctions $wp = null + WPFunctions $wp = null ) { if ($wp === null) { $wp = new WPFunctions(); diff --git a/lib/WP/Notice.php b/lib/WP/Notice.php index cacd044147..d3aa64ed9c 100644 --- a/lib/WP/Notice.php +++ b/lib/WP/Notice.php @@ -18,11 +18,11 @@ class Notice { private $renderInParagraph; public function __construct( - $type, - $message, - $classes = '', - $dataNoticeName = '', - $renderInParagraph = true + $type, + $message, + $classes = '', + $dataNoticeName = '', + $renderInParagraph = true ) { $this->type = $type; $this->message = $message; diff --git a/tasks/GithubClient.php b/tasks/GithubClient.php index ab1669e036..2229fadc47 100644 --- a/tasks/GithubClient.php +++ b/tasks/GithubClient.php @@ -11,9 +11,9 @@ class GithubClient { private const API_BASE_URI = 'https://api.github.com/repos'; public function __construct( - $repo, - $username = null, - $token = null + $repo, + $username = null, + $token = null ) { $config = [ 'headers' => [ diff --git a/tasks/code_sniffer/MailPoet/Sniffs/ControlStructures/FunctionDeclarationSniff.php b/tasks/code_sniffer/MailPoet/Sniffs/ControlStructures/FunctionDeclarationSniff.php new file mode 100644 index 0000000000..5f29235292 --- /dev/null +++ b/tasks/code_sniffer/MailPoet/Sniffs/ControlStructures/FunctionDeclarationSniff.php @@ -0,0 +1,353 @@ +getTokens(); + + if (isset($tokens[$stackPtr]['parenthesis_opener']) === false + || isset($tokens[$stackPtr]['parenthesis_closer']) === false + || $tokens[$stackPtr]['parenthesis_opener'] === null + || $tokens[$stackPtr]['parenthesis_closer'] === null + ) { + return; + } + + $openBracket = $tokens[$stackPtr]['parenthesis_opener']; + + + if ($this->isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens) === true) { + $this->processMultiLineDeclaration($phpcsFile, $stackPtr, $tokens); + } else { + $this->processSingleLineDeclaration($phpcsFile, $stackPtr, $tokens); + } + + }//end process() + + /** + * Determine if this is a multi-line function declaration. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * @param int $openBracket The position of the opening bracket + * in the stack passed in $tokens. + * @param array $tokens The stack of tokens that make up + * the file. + * + * @return bool + */ + public function isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens) { + $closeBracket = $tokens[$openBracket]['parenthesis_closer']; + if ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']) { + return true; + } + + return false; + + }//end isMultiLineDeclaration() + + /** + * Processes single-line declarations. + * + * Just uses the Generic BSD-Allman brace sniff. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * @param array $tokens The stack of tokens that make up + * the file. + * + * @return void + */ + public function processSingleLineDeclaration($phpcsFile, $stackPtr, $tokens) { + + + }//end processSingleLineDeclaration() + + /** + * Processes multi-line declarations. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * @param array $tokens The stack of tokens that make up + * the file. + * + * @return void + */ + public function processMultiLineDeclaration($phpcsFile, $stackPtr, $tokens) { + $this->processArgumentList($phpcsFile, $stackPtr, $this->indent); + + $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; + if ($tokens[$stackPtr]['code'] === T_CLOSURE) { + $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); + if ($use !== false) { + $open = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); + $closeBracket = $tokens[$open]['parenthesis_closer']; + } + } + + if (isset($tokens[$stackPtr]['scope_opener']) === false) { + return; + } + + // The opening brace needs to be one space away from the closing parenthesis. + $opener = $tokens[$stackPtr]['scope_opener']; + if ($tokens[$opener]['line'] !== $tokens[$closeBracket]['line']) { + $error = 'The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line'; + $fix = $phpcsFile->addFixableError($error, $opener, 'NewlineBeforeOpenBrace'); + if ($fix === true) { + $prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($opener - 1), $closeBracket, true); + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($prev, ' {'); + + // If the opener is on a line by itself, removing it will create + // an empty line, so just remove the entire line instead. + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($opener - 1), $closeBracket, true); + $next = $phpcsFile->findNext(T_WHITESPACE, ($opener + 1), null, true); + + if ($tokens[$prev]['line'] < $tokens[$opener]['line'] + && $tokens[$next]['line'] > $tokens[$opener]['line'] + ) { + // Clear the whole line. + for ($i = ($prev + 1); $i < $next; $i++) { + if ($tokens[$i]['line'] === $tokens[$opener]['line']) { + $phpcsFile->fixer->replaceToken($i, ''); + } + } + } else { + // Just remove the opener. + $phpcsFile->fixer->replaceToken($opener, ''); + if ($tokens[$next]['line'] === $tokens[$opener]['line']) { + $phpcsFile->fixer->replaceToken(($opener + 1), ''); + } + } + + $phpcsFile->fixer->endChangeset(); + }//end if + } else { + $prev = $tokens[($opener - 1)]; + if ($prev['code'] !== T_WHITESPACE) { + $length = 0; + } else { + $length = strlen($prev['content']); + } + + if ($length !== 1) { + $error = 'There must be a single space between the closing parenthesis and the opening brace of a multi-line function declaration; found %s spaces'; + $fix = $phpcsFile->addFixableError($error, ($opener - 1), 'SpaceBeforeOpenBrace', [$length]); + if ($fix === true) { + if ($length === 0) { + $phpcsFile->fixer->addContentBefore($opener, ' '); + } else { + $phpcsFile->fixer->replaceToken(($opener - 1), ' '); + } + } + + return; + }//end if + }//end if + + }//end processMultiLineDeclaration() + + /** + * Processes multi-line argument list declarations. + * + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * @param int $indent The number of spaces code should be indented. + * @param string $type The type of the token the brackets + * belong to. + * + * @return void + */ + public function processArgumentList($phpcsFile, $stackPtr, $indent, $type='function') { + $tokens = $phpcsFile->getTokens(); + + // We need to work out how far indented the function + // declaration itself is, so we can work out how far to + // indent parameters. + $functionIndent = 0; + for ($i = ($stackPtr - 1); $i >= 0; $i--) { + if ($tokens[$i]['line'] !== $tokens[$stackPtr]['line']) { + break; + } + } + + // Move $i back to the line the function is or to 0. + $i++; + + if ($tokens[$i]['code'] === T_WHITESPACE) { + $functionIndent = $tokens[$i]['length']; + } + + // The closing parenthesis must be on a new line, even + // when checking abstract function definitions. + $closeBracket = $tokens[$stackPtr]['parenthesis_closer']; + $prev = $phpcsFile->findPrevious( + T_WHITESPACE, + ($closeBracket - 1), + null, + true + ); + + if ($tokens[$closeBracket]['line'] !== $tokens[$tokens[$closeBracket]['parenthesis_opener']]['line'] + && $tokens[$prev]['line'] === $tokens[$closeBracket]['line'] + ) { + $error = 'The closing parenthesis of a multi-line ' . $type . ' declaration must be on a new line'; + $fix = $phpcsFile->addFixableError($error, $closeBracket, 'CloseBracketLine'); + if ($fix === true) { + $phpcsFile->fixer->addNewlineBefore($closeBracket); + } + } + + // If this is a closure and is using a USE statement, the closing + // parenthesis we need to look at from now on is the closing parenthesis + // of the USE statement. + if ($tokens[$stackPtr]['code'] === T_CLOSURE) { + $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); + if ($use !== false) { + $open = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); + $closeBracket = $tokens[$open]['parenthesis_closer']; + + $prev = $phpcsFile->findPrevious( + T_WHITESPACE, + ($closeBracket - 1), + null, + true + ); + + if ($tokens[$closeBracket]['line'] !== $tokens[$tokens[$closeBracket]['parenthesis_opener']]['line'] + && $tokens[$prev]['line'] === $tokens[$closeBracket]['line'] + ) { + $error = 'The closing parenthesis of a multi-line use declaration must be on a new line'; + $fix = $phpcsFile->addFixableError($error, $closeBracket, 'UseCloseBracketLine'); + if ($fix === true) { + $phpcsFile->fixer->addNewlineBefore($closeBracket); + } + } + }//end if + }//end if + + // Each line between the parenthesis should be indented 4 spaces. + $openBracket = $tokens[$stackPtr]['parenthesis_opener']; + $lastLine = $tokens[$openBracket]['line']; + for ($i = ($openBracket + 1); $i < $closeBracket; $i++) { + if ($tokens[$i]['line'] !== $lastLine) { + if ($i === $tokens[$stackPtr]['parenthesis_closer'] + || ($tokens[$i]['code'] === T_WHITESPACE + && (($i + 1) === $closeBracket + || ($i + 1) === $tokens[$stackPtr]['parenthesis_closer'])) + ) { + // Closing braces need to be indented to the same level + // as the function. + $expectedIndent = $functionIndent; + } else { + $expectedIndent = ($functionIndent + $indent); + } + + // We changed lines, so this should be a whitespace indent token. + if ($tokens[$i]['code'] !== T_WHITESPACE) { + $foundIndent = 0; + } else if ($tokens[$i]['line'] !== $tokens[($i + 1)]['line']) { + // This is an empty line, so don't check the indent. + $foundIndent = $expectedIndent; + + $error = 'Blank lines are not allowed in a multi-line ' . $type . ' declaration'; + $fix = $phpcsFile->addFixableError($error, $i, 'EmptyLine'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($i, ''); + } + } else { + $foundIndent = $tokens[$i]['length']; + } + + if ($expectedIndent !== $foundIndent) { + $error = 'Multi-line ' . $type . ' declaration not indented correctly; expected %s spaces but found %s'; + $data = [ + $expectedIndent, + $foundIndent, + ]; + + $fix = $phpcsFile->addFixableError($error, $i, 'Indent', $data); + if ($fix === true) { + $spaces = str_repeat(' ', $expectedIndent); + if ($foundIndent === 0) { + $phpcsFile->fixer->addContentBefore($i, $spaces); + } else { + $phpcsFile->fixer->replaceToken($i, $spaces); + } + } + } + + $lastLine = $tokens[$i]['line']; + }//end if + + if ($tokens[$i]['code'] === T_ARRAY || $tokens[$i]['code'] === T_OPEN_SHORT_ARRAY) { + // Skip arrays as they have their own indentation rules. + if ($tokens[$i]['code'] === T_OPEN_SHORT_ARRAY) { + $i = $tokens[$i]['bracket_closer']; + } else { + $i = $tokens[$i]['parenthesis_closer']; + } + + $lastLine = $tokens[$i]['line']; + continue; + } + }//end for + + }//end processArgumentList() +}//end class diff --git a/tasks/code_sniffer/MailPoet/ruleset.xml b/tasks/code_sniffer/MailPoet/ruleset.xml index 80c9c9ac89..60dabbbbc7 100644 --- a/tasks/code_sniffer/MailPoet/ruleset.xml +++ b/tasks/code_sniffer/MailPoet/ruleset.xml @@ -80,6 +80,8 @@ + + diff --git a/tasks/release/ChangelogController.php b/tasks/release/ChangelogController.php index d46995edac..21826b87c6 100644 --- a/tasks/release/ChangelogController.php +++ b/tasks/release/ChangelogController.php @@ -14,8 +14,8 @@ class ChangelogController { private $jira; public function __construct( - JiraController $jira, - $readmeFile + JiraController $jira, + $readmeFile ) { $this->jira = $jira; $this->readmeFile = $readmeFile; diff --git a/tasks/release/CircleCiController.php b/tasks/release/CircleCiController.php index 9b0d167504..938cd0523d 100644 --- a/tasks/release/CircleCiController.php +++ b/tasks/release/CircleCiController.php @@ -28,10 +28,10 @@ class CircleCiController { private $githubController; public function __construct( - $username, - $token, - $project, - GitHubController $githubController + $username, + $token, + $project, + GitHubController $githubController ) { $this->token = $token; $circleCiProject = $project === self::PROJECT_MAILPOET ? 'mailpoet' : 'mailpoet-premium'; diff --git a/tasks/release/GitHubController.php b/tasks/release/GitHubController.php index d9d0a56f8f..5c71bd95ed 100644 --- a/tasks/release/GitHubController.php +++ b/tasks/release/GitHubController.php @@ -25,9 +25,9 @@ class GitHubController { private $httpClient; public function __construct( - $username, - $token, - $project + $username, + $token, + $project ) { $this->zipFilename = $project === self::PROJECT_MAILPOET ? self::FREE_ZIP_FILENAME : self::PREMIUM_ZIP_FILENAME; $this->httpClient = new Client([ diff --git a/tasks/release/JiraController.php b/tasks/release/JiraController.php index b4c298171b..7aac964634 100644 --- a/tasks/release/JiraController.php +++ b/tasks/release/JiraController.php @@ -31,9 +31,9 @@ class JiraController { private $httpClient; public function __construct( - $token, - $user, - $project + $token, + $user, + $project ) { $this->token = $token; $this->user = $user; diff --git a/tasks/release/ReleaseVersionController.php b/tasks/release/ReleaseVersionController.php index 407188de77..6c276943ca 100644 --- a/tasks/release/ReleaseVersionController.php +++ b/tasks/release/ReleaseVersionController.php @@ -14,9 +14,9 @@ class ReleaseVersionController { private $project; public function __construct( - JiraController $jira, - GitHubController $github, - $project + JiraController $jira, + GitHubController $github, + $project ) { $this->jira = $jira; $this->github = $github; diff --git a/tasks/release/SlackNotifier.php b/tasks/release/SlackNotifier.php index 7715a77841..a90c4a1607 100644 --- a/tasks/release/SlackNotifier.php +++ b/tasks/release/SlackNotifier.php @@ -18,8 +18,8 @@ class SlackNotifier { private $httpClient; public function __construct( - $webhookUrl, - $project + $webhookUrl, + $project ) { $this->webhookUrl = $webhookUrl; $this->project = $project; diff --git a/tests/DataFactories/NewsletterLink.php b/tests/DataFactories/NewsletterLink.php index 9174bb71bf..dfc30a60d0 100644 --- a/tests/DataFactories/NewsletterLink.php +++ b/tests/DataFactories/NewsletterLink.php @@ -15,7 +15,7 @@ class NewsletterLink { private $newsletter; public function __construct( - NewsletterEntity $newsletter + NewsletterEntity $newsletter ) { $this->data = [ 'url' => 'https://example.com/test', diff --git a/tests/DataFactories/StatisticsClicks.php b/tests/DataFactories/StatisticsClicks.php index 83a9616b37..fc180b126d 100644 --- a/tests/DataFactories/StatisticsClicks.php +++ b/tests/DataFactories/StatisticsClicks.php @@ -20,8 +20,8 @@ class StatisticsClicks { private $subscriber; public function __construct( - NewsletterLinkEntity $newsletterLink, - SubscriberEntity $subscriber + NewsletterLinkEntity $newsletterLink, + SubscriberEntity $subscriber ) { $this->data = [ 'count' => 1, diff --git a/tests/DataFactories/StatisticsOpens.php b/tests/DataFactories/StatisticsOpens.php index d95a3d2beb..78cab74fa6 100644 --- a/tests/DataFactories/StatisticsOpens.php +++ b/tests/DataFactories/StatisticsOpens.php @@ -19,8 +19,8 @@ class StatisticsOpens { private $subscriber; public function __construct( - NewsletterEntity $newsletter, - SubscriberEntity $subscriber + NewsletterEntity $newsletter, + SubscriberEntity $subscriber ) { $this->newsletter = $newsletter; $this->subscriber = $subscriber; diff --git a/tests/DataFactories/StatisticsWooCommercePurchases.php b/tests/DataFactories/StatisticsWooCommercePurchases.php index 3491e61678..caaccf60e8 100644 --- a/tests/DataFactories/StatisticsWooCommercePurchases.php +++ b/tests/DataFactories/StatisticsWooCommercePurchases.php @@ -20,8 +20,8 @@ class StatisticsWooCommercePurchases { private $subscriber; public function __construct( - StatisticsClickEntity $click, - $order + StatisticsClickEntity $click, + $order ) { $this->data = [ 'order_id' => $order['id'], diff --git a/tests/DataFactories/UserFlags.php b/tests/DataFactories/UserFlags.php index a8c43164ae..31999eee71 100644 --- a/tests/DataFactories/UserFlags.php +++ b/tests/DataFactories/UserFlags.php @@ -14,7 +14,7 @@ class UserFlags { private $userFlagsRepository; public function __construct( - $userId + $userId ) { $this->userId = $userId; $this->userFlagsRepository = ContainerWrapper::getInstance()->get(UserFlagsRepository::class); diff --git a/tests/DataFactories/WooCommerceCustomer.php b/tests/DataFactories/WooCommerceCustomer.php index 5ebfc00423..d50d93cc61 100644 --- a/tests/DataFactories/WooCommerceCustomer.php +++ b/tests/DataFactories/WooCommerceCustomer.php @@ -11,7 +11,7 @@ class WooCommerceCustomer { private $data; public function __construct( - \AcceptanceTester $tester + \AcceptanceTester $tester ) { $uniqueId = bin2hex(random_bytes(7)); // phpcs:ignore $this->tester = $tester; diff --git a/tests/DataFactories/WooCommerceOrder.php b/tests/DataFactories/WooCommerceOrder.php index 69d69e56fd..2599caca58 100644 --- a/tests/DataFactories/WooCommerceOrder.php +++ b/tests/DataFactories/WooCommerceOrder.php @@ -20,7 +20,7 @@ class WooCommerceOrder { const STATUS_REFUNDED = 'refunded'; public function __construct( - \AcceptanceTester $tester + \AcceptanceTester $tester ) { $uniqueId = bin2hex(random_bytes(7)); // phpcs:ignore $this->tester = $tester; diff --git a/tests/DataFactories/WooCommerceProduct.php b/tests/DataFactories/WooCommerceProduct.php index f77bf9d0ff..ed867099f1 100644 --- a/tests/DataFactories/WooCommerceProduct.php +++ b/tests/DataFactories/WooCommerceProduct.php @@ -19,7 +19,7 @@ class WooCommerceProduct { const TYPE_VARIABLE_SUBSCRIPTION = 'variable-subscription'; public function __construct( - \AcceptanceTester $tester + \AcceptanceTester $tester ) { $this->tester = $tester; $this->data = [ diff --git a/tests/DataGenerator/DataGenerator.php b/tests/DataGenerator/DataGenerator.php index 989d812ed6..119d5c5711 100644 --- a/tests/DataGenerator/DataGenerator.php +++ b/tests/DataGenerator/DataGenerator.php @@ -13,7 +13,7 @@ class DataGenerator { private $console; public function __construct( - Output $console + Output $console ) { $this->console = $console; } diff --git a/tests/SplitTests/SplitTestFilesByGroupsTask.php b/tests/SplitTests/SplitTestFilesByGroupsTask.php index 336c97cd5f..e21f23b8f7 100644 --- a/tests/SplitTests/SplitTestFilesByGroupsTask.php +++ b/tests/SplitTests/SplitTestFilesByGroupsTask.php @@ -33,7 +33,7 @@ class SplitTestFilesByGroupsTask extends BaseTask implements TaskInterface { protected $excludePath = 'vendor'; public function __construct( - $groups + $groups ) { $this->numGroups = $groups; } diff --git a/tests/_support/CleanupExtension.php b/tests/_support/CleanupExtension.php index 5bfaa03283..f490a4f9c8 100644 --- a/tests/_support/CleanupExtension.php +++ b/tests/_support/CleanupExtension.php @@ -26,8 +26,8 @@ class CleanupExtension extends Extension { private $rootConnection; public function __construct( - $config, - $options + $config, + $options ) { parent::__construct($config, $options); $this->rootConnection = new PDO($this->createDsnConnectionString(), self::DB_USERNAME, self::DB_PASSWORD); diff --git a/tests/integration/AutomaticEmails/WooCommerce/WooCommerceStubs/OrderDetails.php b/tests/integration/AutomaticEmails/WooCommerce/WooCommerceStubs/OrderDetails.php index 254397421b..25dc032781 100644 --- a/tests/integration/AutomaticEmails/WooCommerce/WooCommerceStubs/OrderDetails.php +++ b/tests/integration/AutomaticEmails/WooCommerce/WooCommerceStubs/OrderDetails.php @@ -11,7 +11,7 @@ class OrderDetails { public $orderId; public function __construct( - $orderId = null + $orderId = null ) { $this->orderId = $orderId; } diff --git a/tests/integration/Newsletter/ShortcodesTest.php b/tests/integration/Newsletter/ShortcodesTest.php index a0d9c97b14..fa23e05bec 100644 --- a/tests/integration/Newsletter/ShortcodesTest.php +++ b/tests/integration/Newsletter/ShortcodesTest.php @@ -106,7 +106,8 @@ class ShortcodesTest extends \MailPoetTest { $result = $shortcodesObject->process($shortcode); expect($result[0])->false(); add_filter('mailpoet_newsletter_shortcode', function( - $shortcode, $newsletter, $subscriber, $queue, $content, $arguments) { + $shortcode, $newsletter, $subscriber, $queue, $content, $arguments +) { expect($arguments)->count(2); expect($arguments['arg1'])->equals('val1'); expect($arguments['arg2'])->equals('val2'); diff --git a/tests/integration/Services/BridgeTestMockAPI.php b/tests/integration/Services/BridgeTestMockAPI.php index cc3dbd5520..86c1b70231 100644 --- a/tests/integration/Services/BridgeTestMockAPI.php +++ b/tests/integration/Services/BridgeTestMockAPI.php @@ -9,7 +9,7 @@ class BridgeTestMockAPI extends API { public $apiKey; public function __construct( - $apiKey + $apiKey ) { parent::__construct($apiKey); $this->setKey($apiKey);