Add public keyword to methods

[MAILPOET-2413]
This commit is contained in:
Amine Ben hammou
2019-12-26 12:56:49 +01:00
committed by wxa
parent ec409042d5
commit 43df66d162
823 changed files with 4440 additions and 4440 deletions

View File

@@ -13,19 +13,19 @@ class AfterMigrationNotice {
/** @var SettingsController */
private $settings;
function __construct() {
public function __construct() {
$this->settings = SettingsController::getInstance();
}
function enable() {
public function enable() {
$this->settings->set(self::OPTION_NAME, true);
}
function disable() {
public function disable() {
$this->settings->set(self::OPTION_NAME, false);
}
function init($should_display) {
public function init($should_display) {
if ($should_display && $this->settings->get(self::OPTION_NAME, false)) {
return $this->display();
}

View File

@@ -11,7 +11,7 @@ class BlackFridayNotice {
const OPTION_NAME = 'dismissed-black-friday-notice';
const DISMISS_NOTICE_TIMEOUT_SECONDS = 2592000; // 30 days
function init($should_display) {
public function init($should_display) {
$should_display = $should_display
&& (time() <= strtotime('2019-11-30 23:59:59'))
&& (time() >= strtotime('2019-11-08 00:00:00'))
@@ -36,7 +36,7 @@ class BlackFridayNotice {
WPNotice::displaySuccess($header . $body . $link, $extra_classes, self::OPTION_NAME);
}
function disable() {
public function disable() {
WPFunctions::get()->setTransient(self::OPTION_NAME, true, self::DISMISS_NOTICE_TIMEOUT_SECONDS);
}

View File

@@ -18,12 +18,12 @@ class InactiveSubscribersNotice {
/** @var WPFunctions */
private $wp;
function __construct(SettingsController $settings, WPFunctions $wp) {
public function __construct(SettingsController $settings, WPFunctions $wp) {
$this->settings = $settings;
$this->wp = $wp;
}
function init($should_display) {
public function init($should_display) {
if (!$should_display || !$this->settings->get(self::OPTION_NAME, true)) {
return;
}
@@ -41,7 +41,7 @@ class InactiveSubscribersNotice {
return $this->display($inactive_subscribers_count);
}
function disable() {
public function disable() {
$this->settings->set(self::OPTION_NAME, false);
}

View File

@@ -11,17 +11,17 @@ class PHPVersionWarnings {
const DISMISS_NOTICE_TIMEOUT_SECONDS = 2592000; // 30 days
const OPTION_NAME = 'dismissed-php-version-outdated-notice';
function init($php_version, $should_display) {
public function init($php_version, $should_display) {
if ($should_display && $this->isOutdatedPHPVersion($php_version)) {
return $this->display($php_version);
}
}
function isOutdatedPHPVersion($php_version) {
public function isOutdatedPHPVersion($php_version) {
return version_compare($php_version, '7.0', '<') && !get_transient(self::OPTION_NAME);
}
function display($php_version) {
public function display($php_version) {
$error_string = __('Your website is running on PHP %s which MailPoet does not officially support. Read our [link]simple PHP upgrade guide[/link] or let MailPoets support team upgrade it for you.', 'mailpoet');
$error_string = sprintf($error_string, $php_version);
$get_in_touch_string = __('[link]Yes, I want MailPoet to help me upgrade for free[/link]', 'mailpoet');
@@ -37,7 +37,7 @@ class PHPVersionWarnings {
return Notice::displayWarning($error, $extra_classes, self::OPTION_NAME);
}
function disable() {
public function disable() {
WPFunctions::get()->setTransient(self::OPTION_NAME, true, self::DISMISS_NOTICE_TIMEOUT_SECONDS);
}

View File

@@ -71,7 +71,7 @@ class PermanentNotices {
);
}
function ajaxDismissNoticeHandler() {
public function ajaxDismissNoticeHandler() {
if (!isset($_POST['type'])) return;
switch ($_POST['type']) {
case (PHPVersionWarnings::OPTION_NAME):

View File

@@ -23,19 +23,19 @@ class UnauthorizedEmailInNewslettersNotice {
/** @var WPFunctions */
private $wp;
function __construct(SettingsController $settings, WPFunctions $wp) {
public function __construct(SettingsController $settings, WPFunctions $wp) {
$this->settings = $settings;
$this->wp = $wp;
}
function init($should_display) {
public function init($should_display) {
$validation_error = $this->settings->get(AuthorizedEmailsController::AUTHORIZED_EMAIL_ADDRESSES_ERROR_SETTING);
if ($should_display && isset($validation_error['invalid_senders_in_newsletters'])) {
return $this->display($validation_error);
}
}
function display($validation_error) {
public function display($validation_error) {
$message = $this->getMessageText();
$message .= $this->getNewslettersLinks($validation_error);
$message .= $this->getAuthorizationLink($validation_error);

View File

@@ -19,19 +19,19 @@ class UnauthorizedEmailNotice {
/** @var WPFunctions */
private $wp;
function __construct(SettingsController $settings, WPFunctions $wp) {
public function __construct(SettingsController $settings, WPFunctions $wp) {
$this->settings = $settings;
$this->wp = $wp;
}
function init($should_display) {
public function init($should_display) {
$validation_error = $this->settings->get(AuthorizedEmailsController::AUTHORIZED_EMAIL_ADDRESSES_ERROR_SETTING);
if ($should_display && isset($validation_error['invalid_sender_address'])) {
return $this->display($validation_error);
}
}
function display($validation_error) {
public function display($validation_error) {
$message = $this->getMessageText($validation_error);
$message .= $this->getSettingsButtons($validation_error);
$message .= $this->getAuthorizationLink($validation_error);