Add public keyword to methods
[MAILPOET-2413]
This commit is contained in:
@@ -4,47 +4,47 @@ namespace MailPoet\WooCommerce;
|
||||
|
||||
class Helper {
|
||||
|
||||
function isWooCommerceActive() {
|
||||
public function isWooCommerceActive() {
|
||||
return class_exists('WooCommerce');
|
||||
}
|
||||
|
||||
function WC() {
|
||||
public function WC() {
|
||||
return WC();
|
||||
}
|
||||
|
||||
function wcGetCustomerOrderCount($user_id) {
|
||||
public function wcGetCustomerOrderCount($user_id) {
|
||||
return wc_get_customer_order_count($user_id);
|
||||
}
|
||||
|
||||
function wcGetOrder($order = false) {
|
||||
public function wcGetOrder($order = false) {
|
||||
return wc_get_order($order);
|
||||
}
|
||||
|
||||
function wcGetOrders(array $args) {
|
||||
public function wcGetOrders(array $args) {
|
||||
return wc_get_orders($args);
|
||||
}
|
||||
|
||||
function wcPrice($price, array $args = []) {
|
||||
public function wcPrice($price, array $args = []) {
|
||||
return wc_price($price, $args);
|
||||
}
|
||||
|
||||
function wcGetProduct($the_product = false) {
|
||||
public function wcGetProduct($the_product = false) {
|
||||
return wc_get_product($the_product);
|
||||
}
|
||||
|
||||
function getWoocommerceCurrency() {
|
||||
public function getWoocommerceCurrency() {
|
||||
return get_woocommerce_currency();
|
||||
}
|
||||
|
||||
function wcLightOrDark($color, $dark, $light) {
|
||||
public function wcLightOrDark($color, $dark, $light) {
|
||||
return wc_light_or_dark($color, $dark, $light);
|
||||
}
|
||||
|
||||
function wcHexIsLight($color) {
|
||||
public function wcHexIsLight($color) {
|
||||
return wc_hex_is_light($color);
|
||||
}
|
||||
|
||||
function getOrdersCountCreatedBefore($date_time) {
|
||||
public function getOrdersCountCreatedBefore($date_time) {
|
||||
global $wpdb;
|
||||
$result = $wpdb->get_var( "
|
||||
SELECT DISTINCT count(p.ID) FROM {$wpdb->prefix}posts as p
|
||||
@@ -53,7 +53,7 @@ class Helper {
|
||||
return (int)$result;
|
||||
}
|
||||
|
||||
function getRawPrice($price, array $args = []) {
|
||||
public function getRawPrice($price, array $args = []) {
|
||||
$html_price = $this->wcPrice($price, $args);
|
||||
return html_entity_decode(strip_tags($html_price));
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ class Settings {
|
||||
/** @var SettingsController */
|
||||
private $settings;
|
||||
|
||||
function __construct(
|
||||
public function __construct(
|
||||
Renderer $renderer,
|
||||
SettingsController $settings
|
||||
) {
|
||||
@@ -22,7 +22,7 @@ class Settings {
|
||||
$this->settings = $settings;
|
||||
}
|
||||
|
||||
function disableWooCommerceSettings() {
|
||||
public function disableWooCommerceSettings() {
|
||||
if (
|
||||
!isset($_GET['tab'])
|
||||
|| $_GET['tab'] !== 'email'
|
||||
|
@@ -21,7 +21,7 @@ class Subscription {
|
||||
/** @var WPFunctions */
|
||||
private $wp;
|
||||
|
||||
function __construct(
|
||||
public function __construct(
|
||||
SettingsController $settings,
|
||||
WPFunctions $wp
|
||||
) {
|
||||
@@ -29,7 +29,7 @@ class Subscription {
|
||||
$this->wp = $wp;
|
||||
}
|
||||
|
||||
function extendWooCommerceCheckoutForm() {
|
||||
public function extendWooCommerceCheckoutForm() {
|
||||
$input_name = self::CHECKOUT_OPTIN_INPUT_NAME;
|
||||
$checked = $this->isCurrentUserSubscribed();
|
||||
if (!empty($_POST[self::CHECKOUT_OPTIN_INPUT_NAME])) {
|
||||
@@ -67,7 +67,7 @@ class Subscription {
|
||||
&& $subscriber_segment->status === Subscriber::STATUS_SUBSCRIBED;
|
||||
}
|
||||
|
||||
function subscribeOnCheckout($order_id, $data) {
|
||||
public function subscribeOnCheckout($order_id, $data) {
|
||||
if (empty($data['billing_email'])) {
|
||||
// no email in posted order data
|
||||
return null;
|
||||
|
@@ -35,7 +35,7 @@ class TransactionalEmails {
|
||||
/** @var NewslettersRepository */
|
||||
private $newsletters_repository;
|
||||
|
||||
function __construct(WPFunctions $wp, SettingsController $settings, Template $template, Renderer $renderer, Helper $woocommerce_helper, NewslettersRepository $newsletters_repository) {
|
||||
public function __construct(WPFunctions $wp, SettingsController $settings, Template $template, Renderer $renderer, Helper $woocommerce_helper, NewslettersRepository $newsletters_repository) {
|
||||
$this->wp = $wp;
|
||||
$this->settings = $settings;
|
||||
$this->template = $template;
|
||||
|
@@ -20,7 +20,7 @@ class Renderer {
|
||||
/** @var string */
|
||||
private $html_after_content;
|
||||
|
||||
function __construct(csstidy $css_parser) {
|
||||
public function __construct(csstidy $css_parser) {
|
||||
$this->css_parser = $css_parser;
|
||||
$this->html_before_content = '';
|
||||
$this->html_after_content = '';
|
||||
|
Reference in New Issue
Block a user