Add public keyword to methods
[MAILPOET-2413]
This commit is contained in:
@@ -12,7 +12,7 @@ class BulkAction {
|
||||
private $data = null;
|
||||
private $wp;
|
||||
|
||||
function __construct($data) {
|
||||
public function __construct($data) {
|
||||
$this->data = $data;
|
||||
$this->wp = new WPFunctions;
|
||||
}
|
||||
@@ -21,7 +21,7 @@ class BulkAction {
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
function apply() {
|
||||
public function apply() {
|
||||
if (!isset($this->data['listing']['filter']['segment'])) {
|
||||
throw new \InvalidArgumentException('Missing segment id');
|
||||
}
|
||||
|
@@ -16,14 +16,14 @@ class SubscribersFinder {
|
||||
/** @var WPFunctions */
|
||||
private $wp;
|
||||
|
||||
function __construct(WPFunctions $wp = null) {
|
||||
public function __construct(WPFunctions $wp = null) {
|
||||
if (!$wp) {
|
||||
$wp = new WPFunctions;
|
||||
}
|
||||
$this->wp = $wp;
|
||||
}
|
||||
|
||||
function findSubscribersInSegments($subscribers_to_process_ids, $newsletter_segments_ids) {
|
||||
public function findSubscribersInSegments($subscribers_to_process_ids, $newsletter_segments_ids) {
|
||||
$result = [];
|
||||
foreach ($newsletter_segments_ids as $segment_id) {
|
||||
$segment = Segment::findOne($segment_id);
|
||||
@@ -54,7 +54,7 @@ class SubscribersFinder {
|
||||
return in_array($segment->type, [Segment::TYPE_DEFAULT, Segment::TYPE_WP_USERS, Segment::TYPE_WC_USERS], true);
|
||||
}
|
||||
|
||||
function addSubscribersToTaskFromSegments(ScheduledTask $task, array $segments) {
|
||||
public function addSubscribersToTaskFromSegments(ScheduledTask $task, array $segments) {
|
||||
// Prepare subscribers on the DB side for performance reasons
|
||||
$staticSegments = [];
|
||||
$dynamicSegments = [];
|
||||
|
@@ -13,12 +13,12 @@ class SubscribersListings {
|
||||
|
||||
private $wp;
|
||||
|
||||
function __construct(Handler $handler, WPFunctions $wp) {
|
||||
public function __construct(Handler $handler, WPFunctions $wp) {
|
||||
$this->handler = $handler;
|
||||
$this->wp = $wp;
|
||||
}
|
||||
|
||||
function getListingsInSegment($data) {
|
||||
public function getListingsInSegment($data) {
|
||||
if (!isset($data['filter']['segment'])) {
|
||||
throw new \InvalidArgumentException('Missing segment id');
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ use MailPoet\Subscribers\Source;
|
||||
use MailPoetVendor\Idiorm\ORM;
|
||||
|
||||
class WP {
|
||||
static function synchronizeUser($wp_user_id, $old_wp_user_data = false) {
|
||||
public static function synchronizeUser($wp_user_id, $old_wp_user_data = false) {
|
||||
$wp_user = \get_userdata($wp_user_id);
|
||||
$wp_segment = Segment::getWPSegment();
|
||||
|
||||
@@ -85,7 +85,7 @@ class WP {
|
||||
}
|
||||
}
|
||||
|
||||
static function synchronizeUsers() {
|
||||
public static function synchronizeUsers() {
|
||||
|
||||
$updated_users_emails = self::updateSubscribersEmails();
|
||||
$inserted_users_emails = self::insertSubscribers();
|
||||
@@ -238,8 +238,8 @@ class WP {
|
||||
global $wpdb;
|
||||
$query = '
|
||||
UPDATE %s as subscribers
|
||||
LEFT JOIN %s as clicks ON subscribers.id=clicks.subscriber_id
|
||||
LEFT JOIN %s as opens ON subscribers.id=opens.subscriber_id
|
||||
LEFT JOIN %s as clicks ON subscribers.id=clicks.subscriber_id
|
||||
LEFT JOIN %s as opens ON subscribers.id=opens.subscriber_id
|
||||
JOIN %s as usermeta ON usermeta.user_id=subscribers.wp_user_id AND usermeta.meta_key = "default_password_nag" AND usermeta.meta_value = "1"
|
||||
SET `status` = "unconfirmed"
|
||||
WHERE `wp_user_id` IS NOT NULL AND `status` = "subscribed" AND `confirmed_at` IS NULL AND clicks.id IS NULL AND opens.id IS NULL
|
||||
|
@@ -22,12 +22,12 @@ class WooCommerce {
|
||||
private $mailpoet_email_collation;
|
||||
private $wp_postmeta_value_collation;
|
||||
|
||||
function __construct(SettingsController $settings, WPFunctions $wp) {
|
||||
public function __construct(SettingsController $settings, WPFunctions $wp) {
|
||||
$this->settings = $settings;
|
||||
$this->wp = $wp;
|
||||
}
|
||||
|
||||
function synchronizeRegisteredCustomer($wp_user_id, $current_filter = null) {
|
||||
public function synchronizeRegisteredCustomer($wp_user_id, $current_filter = null) {
|
||||
$wc_segment = Segment::getWooCommerceSegment();
|
||||
|
||||
if ($wc_segment === false) return;
|
||||
@@ -75,7 +75,7 @@ class WooCommerce {
|
||||
return true;
|
||||
}
|
||||
|
||||
function synchronizeGuestCustomer($order_id, $current_filter = null) {
|
||||
public function synchronizeGuestCustomer($order_id, $current_filter = null) {
|
||||
$wc_order = $this->wp->getPost($order_id);
|
||||
$wc_segment = Segment::getWooCommerceSegment();
|
||||
|
||||
@@ -97,7 +97,7 @@ class WooCommerce {
|
||||
}
|
||||
}
|
||||
|
||||
function synchronizeCustomers() {
|
||||
public function synchronizeCustomers() {
|
||||
$this->getColumnCollation();
|
||||
|
||||
WP::synchronizeUsers(); // synchronize registered users
|
||||
|
Reference in New Issue
Block a user