diff --git a/CHANGELOG.md b/CHANGELOG.md index 3db02ccaa1..49c1d2b5e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Releases +### [5.0.27] + +#### Added + - [Add Venmo funding option to PayPal Commerce (#1522)](https://github.com/eventespresso/cafe/pull/1522) + +#### Fixed + - [Dont replace checkout type with PPC funding options in extra meta inputs (#1534)](https://github.com/eventespresso/cafe/pull/1534) + - [Add Billing Form Instance Check (#1537)](https://github.com/eventespresso/cafe/pull/1537) + - [Fix GraphQL requests when WP is installed in a subdirectory (#1531)](https://github.com/eventespresso/cafe/pull/1531) + +#### Changed + - [Fix phpdoc tags (#1505)](https://github.com/eventespresso/cafe/pull/1505) + - [auto lint fixes (#1358)](https://github.com/eventespresso/cafe/pull/1358) + + ### [5.0.26] + #### Fixed - Fixed PHP 7.4 Incompatible Code in InterfaceManager diff --git a/PaymentMethods/PayPalCommerce/PayPalCheckout/EEG_PayPalCheckout.gateway.php b/PaymentMethods/PayPalCommerce/PayPalCheckout/EEG_PayPalCheckout.gateway.php index 62fbb2d23e..ba3ec83e38 100644 --- a/PaymentMethods/PayPalCommerce/PayPalCheckout/EEG_PayPalCheckout.gateway.php +++ b/PaymentMethods/PayPalCommerce/PayPalCheckout/EEG_PayPalCheckout.gateway.php @@ -145,9 +145,9 @@ public static function createPayment(EE_Transaction $transaction, EE_Payment_Met */ public static function updatePaymentStatus( EE_Payment $payment, - string $status, - $response_data, - string $update_message = '' + string $status, + $response_data, + string $update_message = '' ): EE_Payment { $paypal_pm = ! empty($payment->payment_method()) ? EEM_Payment_Method::instance()->get_one_by_slug($payment->payment_method()->name()) @@ -195,10 +195,10 @@ public static function updatePaymentStatus( * @throws ReflectionException */ public static function saveBillingDetails( - EE_Payment $payment, + EE_Payment $payment, EE_Transaction $transaction, - array $order, - array $billing_info + array $order, + array $billing_info ): void { $primary_reg = $transaction->primary_registration(); $attendee = $primary_reg instanceof EE_Registration ? $primary_reg->attendee() : null; diff --git a/PaymentMethods/PayPalCommerce/PayPalCheckout/EE_PMT_PayPalCheckout.pm.php b/PaymentMethods/PayPalCommerce/PayPalCheckout/EE_PMT_PayPalCheckout.pm.php index 2574df5732..ef69b82e3c 100644 --- a/PaymentMethods/PayPalCommerce/PayPalCheckout/EE_PMT_PayPalCheckout.pm.php +++ b/PaymentMethods/PayPalCommerce/PayPalCheckout/EE_PMT_PayPalCheckout.pm.php @@ -144,7 +144,7 @@ public static function refundNotice(bool $can_edit_payments) } // Try loading the template. EE_Registry::instance()->load_helper('Template'); - } catch (EE_Error|ReflectionException $e) { + } catch (EE_Error | ReflectionException $e) { // Just return, adding nothing. return; } @@ -174,12 +174,12 @@ public static function refundNotice(bool $can_edit_payments) */ public function process_payment( EE_Transaction $transaction, - $amount = null, - $billing_info = null, - $return_url = null, - $fail_url = '', - $method = 'CART', - $by_admin = false + $amount = null, + $billing_info = null, + $return_url = null, + $fail_url = '', + $method = 'CART', + $by_admin = false ): EE_Payment { // This payment should have been processed in the background, while the Order was created and charged. // So simply return the last payment. Unless it's somehow missing. diff --git a/PaymentMethods/PayPalCommerce/PayPalCheckout/forms/BillingForm.php b/PaymentMethods/PayPalCommerce/PayPalCheckout/forms/BillingForm.php index bb815c30a5..2d510134c8 100644 --- a/PaymentMethods/PayPalCommerce/PayPalCheckout/forms/BillingForm.php +++ b/PaymentMethods/PayPalCommerce/PayPalCheckout/forms/BillingForm.php @@ -38,7 +38,6 @@ */ class BillingForm extends EE_Billing_Attendee_Info_Form { - protected EE_Payment_Method $paypal_pmt; protected ?EE_Transaction $transaction = null; @@ -216,7 +215,8 @@ public static function excludeBillingFormFields( } // Make sure the billing form subsections have correct names. $inputs = $billing_form->inputs_in_subsections(); - if (! empty($request_params['process_form_submission']) + if ( + ! empty($request_params['process_form_submission']) && $request_params['process_form_submission'] === '1' && ! empty($request_params['eep_ppc_skip_form_validation']) ) { @@ -460,22 +460,56 @@ public function addDataTagsToScript($tag, $handle): string */ public function enqueue_js(): void { - $third_party = EED_PayPalCommerce::isThirdParty($this->_pm_instance); - $currency = CurrencyManager::currencyCode(); + // Setup default values $client_id_key = Domain::META_KEY_CLIENT_ID; - // Scripts. - $scripts_src = 'https://www.paypal.com/sdk/js?components=buttons,hosted-fields&intent=capture'; - if ($third_party) { + $merchant_id = false; + $funding_options = ['venmo', 'paylater']; + + // Override the above if thrid party integration + if (EED_PayPalCommerce::isThirdParty($this->_pm_instance)) { $client_id_key = Domain::META_KEY_PARTNER_CLIENT_ID; $merchant_id = PayPalExtraMetaManager::getPmOption( $this->_pm_instance, Domain::META_KEY_SELLER_MERCHANT_ID ); - $scripts_src .= "&merchant-id=$merchant_id"; } - $client_id = PayPalExtraMetaManager::getPmOption($this->_pm_instance, $client_id_key); - $scripts_src .= "&client-id=$client_id¤cy=$currency"; - wp_enqueue_script('eea_paypal_commerce_js_lib', $scripts_src, [], null); + + // Setup query args + $url_params = [ + 'client-id' => PayPalExtraMetaManager::getPmOption($this->_pm_instance, $client_id_key), + 'currency' => CurrencyManager::currencyCode(), + 'components' => implode(',', ['buttons','hosted-fields']), + 'intent' => 'capture', + 'merchant-id' => $merchant_id, + ]; + + // Which funding methods are active? + $enabled_funding = $this->_pm_instance->get_extra_meta(Domain::META_KEY_FUNDING_OPTIONS, true, $funding_options); + + // Any funding method not enabled should be disabled. + $disabled_funding = array_diff( + $funding_options, + $enabled_funding + ); + + // Any funding options enabled? + if (count($enabled_funding) > 0) { + $url_params['enable-funding'] = implode(',', $enabled_funding); + } + + // Any funding options disabled? + if (count($disabled_funding) > 0) { + $url_params['disable-funding'] = implode(',', $disabled_funding); + } + + // Enqueue the PayPal JS + wp_enqueue_script( + 'eea_paypal_commerce_js_lib', + add_query_arg($url_params, 'https://www.paypal.com/sdk/js'), + [], + null + ); + wp_enqueue_script( 'eea_paypal_commerce_js', EEP_PAYPAL_COMMERCE_URL . 'assets/js/paypal-commerce-payments.js', diff --git a/PaymentMethods/PayPalCommerce/PayPalCheckout/forms/OnboardingFormHtml.php b/PaymentMethods/PayPalCommerce/PayPalCheckout/forms/OnboardingFormHtml.php index a49008d487..880391a8ed 100644 --- a/PaymentMethods/PayPalCommerce/PayPalCheckout/forms/OnboardingFormHtml.php +++ b/PaymentMethods/PayPalCommerce/PayPalCheckout/forms/OnboardingFormHtml.php @@ -355,7 +355,7 @@ public function paymentOptionsHtml(): string '', '', '', - 'for="' . 'eep_ppc_checkout_type_' . $this->pm_slug .'-express_checkout"' + 'for="' . 'eep_ppc_checkout_type_' . $this->pm_slug . '-express_checkout"' ); $ppcp_lbl = EEH_HTML::label( esc_html__('Accept credit and debit card payments with PayPal ', 'event_espresso') @@ -368,7 +368,7 @@ public function paymentOptionsHtml(): string '', '', '', - 'for="' . 'eep_ppc_checkout_type_' . $this->pm_slug .'-ppcp"' + 'for="' . 'eep_ppc_checkout_type_' . $this->pm_slug . '-ppcp"' ); $checkbox = new EE_Checkbox_Multi_Input( [ diff --git a/PaymentMethods/PayPalCommerce/PayPalCheckout/forms/SettingsForm.php b/PaymentMethods/PayPalCommerce/PayPalCheckout/forms/SettingsForm.php index 5ff1aac107..868504b660 100644 --- a/PaymentMethods/PayPalCommerce/PayPalCheckout/forms/SettingsForm.php +++ b/PaymentMethods/PayPalCommerce/PayPalCheckout/forms/SettingsForm.php @@ -9,6 +9,7 @@ use EE_Error; use EE_Form_Section_HTML; use EE_Select_Input; +use EE_Checkbox_Multi_Input; use EED_PayPalOnboard; use EEH_HTML; use EventEspresso\PaymentMethods\PayPalCommerce\domain\Domain; @@ -57,6 +58,7 @@ public function __construct(EE_PMT_PayPalCheckout $payment_method, EE_Payment_Me $is_onboard = EED_PayPalOnboard::isOnboard($pm_instance); if ($is_onboard && ($allowed_type === 'ppcp' || $allowed_type === 'all')) { $form_parameters = $this->addCheckoutTypeSelect($form_parameters); + $form_parameters = $this->addFundingOptions($form_parameters); } // Build the PM form. parent::__construct($form_parameters); @@ -159,27 +161,53 @@ public function addFeesNotice(): void public function addCheckoutTypeSelect(array $form_parameters): array { $pm_slug = $this->pm_instance->slug(); - $allowed_checkout_type = PayPalExtraMetaManager::getPmOption( - $this->pm_instance, - Domain::META_KEY_ALLOWED_CHECKOUT_TYPE + // Section to be displayed if onboard. + $form_parameters['extra_meta_inputs'][Domain::META_KEY_CHECKOUT_TYPE] = new EE_Select_Input( + [ + 'express_checkout' => esc_html__('Express Checkout', 'event_espresso'), + 'ppcp' => esc_html__('Advanced Credit and Debit Card payments', 'event_espresso'), + 'all' => esc_html__('Both, ACDC and Express Checkout', 'event_espresso'), + ], + [ + 'html_name' => "eep_checkout_type_option_$pm_slug", + 'html_id' => "eep_checkout_type_option_$pm_slug", + 'html_class' => "eep-checkout-type-option-$pm_slug", + 'required' => true, + 'default' => PayPalExtraMetaManager::getPmOption( + $this->pm_instance, + Domain::META_KEY_ALLOWED_CHECKOUT_TYPE + ), + ] ); + return $form_parameters; + } + + + /** + * Add a checkout type select. + * + * @param array $form_parameters + * @return array + * @throws EE_Error + * @throws ReflectionException + */ + public function addFundingOptions(array $form_parameters): array + { + $pm_slug = $this->pm_instance->slug(); // Section to be displayed if onboard. - $form_parameters['extra_meta_inputs'] = [ - Domain::META_KEY_CHECKOUT_TYPE => new EE_Select_Input( - [ - 'express_checkout' => esc_html__('Express Checkout', 'event_espresso'), - 'ppcp' => esc_html__('Advanced Credit and Debit Card payments', 'event_espresso'), - 'all' => esc_html__('Both, ACDC and Express Checkout', 'event_espresso'), - ], - [ - 'html_name' => 'eep_checkout_type_option_' . $pm_slug, - 'html_id' => 'eep_checkout_type_option_' . $pm_slug, - 'html_class' => 'eep-checkout-type-option-' . $pm_slug, - 'required' => true, - 'default' => $allowed_checkout_type, - ] - ), - ]; + $form_parameters['extra_meta_inputs'][Domain::META_KEY_FUNDING_OPTIONS] = new EE_Checkbox_Multi_Input( + [ + 'venmo' => esc_html__('Venmo', 'event_espresso'), + 'paylater' => esc_html__('PayLater', 'event_espresso'), + ], + [ + 'html_name' => "eep_checkout_funding_options_$pm_slug", + 'html_id' => "eep_checkout_funding_options_$pm_slug", + 'html_class' => "eep-checkout-funding-options-$pm_slug", + 'html_label_text' => esc_html__('Enable PayPal funding options:', 'event_espresso'), + 'default' => ['venmo', 'paylater'], + ] + ); return $form_parameters; } diff --git a/PaymentMethods/PayPalCommerce/api/orders/CaptureOrder.php b/PaymentMethods/PayPalCommerce/api/orders/CaptureOrder.php index 759d2344db..6370dba26a 100644 --- a/PaymentMethods/PayPalCommerce/api/orders/CaptureOrder.php +++ b/PaymentMethods/PayPalCommerce/api/orders/CaptureOrder.php @@ -90,7 +90,8 @@ public function validateOrder($response): array return $response; } // This also could be a retry capture, so consider this valid, if order already captured. - if (! empty($response['message']['details']['issue']) + if ( + ! empty($response['message']['details']['issue']) && $response['message']['details']['issue'] === 'ORDER_ALREADY_CAPTURED' ) { // Need to make sure we pass on the order ID. diff --git a/PaymentMethods/PayPalCommerce/domain/Domain.php b/PaymentMethods/PayPalCommerce/domain/Domain.php index c6d5527d64..7d65df486c 100644 --- a/PaymentMethods/PayPalCommerce/domain/Domain.php +++ b/PaymentMethods/PayPalCommerce/domain/Domain.php @@ -106,6 +106,11 @@ class Domain */ public const META_KEY_CHECKOUT_TYPE = 'checkout_type'; + /** + * Name of the extra meta that stores the selected PP function options. + */ + public const META_KEY_FUNDING_OPTIONS = 'funding_options'; + /** * Name of the PayPal API parameter that holds the auth code. */ diff --git a/PaymentMethods/PayPalCommerce/modules/EED_PayPalCommerce.module.php b/PaymentMethods/PayPalCommerce/modules/EED_PayPalCommerce.module.php index fa36abb847..0b8cf01aa9 100644 --- a/PaymentMethods/PayPalCommerce/modules/EED_PayPalCommerce.module.php +++ b/PaymentMethods/PayPalCommerce/modules/EED_PayPalCommerce.module.php @@ -232,8 +232,8 @@ public static function createOrder( public static function captureOrder( EE_Transaction $transaction, EE_Payment_Method $paypal_pm, - string $order_id, - array $billing_info + string $order_id, + array $billing_info ): array { $capture_order_api = EED_PayPalCommerce::getCaptureOrderApi($transaction, $paypal_pm, $order_id); if (! $capture_order_api instanceof CaptureOrder) { @@ -349,7 +349,11 @@ public static function getPayPalApi(EE_Payment_Method $paypal_pm): ?PayPalApi $partner_client_id = PayPalExtraMetaManager::getPmOption($paypal_pm, Domain::META_KEY_PARTNER_CLIENT_ID) ?: ''; $payer_id = PayPalExtraMetaManager::getPmOption($paypal_pm, Domain::META_KEY_SELLER_MERCHANT_ID) ?: ''; return new ThirdPartyPayPalApi( - $access_token, $bn_code, $partner_client_id, $payer_id, $paypal_pm->debug_mode() + $access_token, + $bn_code, + $partner_client_id, + $payer_id, + $paypal_pm->debug_mode() ); } diff --git a/PaymentMethods/PayPalCommerce/tools/fees/PartnerPaymentFees.php b/PaymentMethods/PayPalCommerce/tools/fees/PartnerPaymentFees.php index f9ff8d3a65..d034d6b0a9 100644 --- a/PaymentMethods/PayPalCommerce/tools/fees/PartnerPaymentFees.php +++ b/PaymentMethods/PayPalCommerce/tools/fees/PartnerPaymentFees.php @@ -7,7 +7,6 @@ use EventEspresso\PaymentMethods\PayPalCommerce\tools\currency\CurrencyManager; use Exception; - /** * Class PartnerPaymentFees * diff --git a/PaymentMethods/PayPalCommerce/tools/logging/PayPalLogger.php b/PaymentMethods/PayPalCommerce/tools/logging/PayPalLogger.php index 806e9d501b..efd3532f9d 100644 --- a/PaymentMethods/PayPalCommerce/tools/logging/PayPalLogger.php +++ b/PaymentMethods/PayPalCommerce/tools/logging/PayPalLogger.php @@ -86,7 +86,7 @@ public static function errorLog( if ($popup_log) { PayPalLogger::logInWindow(json_encode($data)); } - } catch (ReflectionException|EE_Error $error) { + } catch (ReflectionException | EE_Error $error) { new ExceptionLogger($error); return false; } diff --git a/admin_pages/about/templates/whats_new.template.php b/admin_pages/about/templates/whats_new.template.php index 96cb3288dc..d17c71d781 100644 --- a/admin_pages/about/templates/whats_new.template.php +++ b/admin_pages/about/templates/whats_new.template.php @@ -1,4 +1,5 @@ _display_legend($this->_event_legend_items()); $this->_admin_page_title .= ' ' . $this->get_action_link_or_button( - 'create_new', - 'add', - [], - 'add-new-h2' - ); + 'create_new', + 'add', + [], + 'add-new-h2' + ); $this->_template_args['after_list_table'] = array_merge( (array) $this->_template_args['after_list_table'], @@ -1373,8 +1373,8 @@ protected function _default_tickets_update(EE_Event $event, array $data): array ); } $ticket_sold = $existing_ticket->count_related( - 'Registration', - [ + 'Registration', + [ [ 'STS_ID' => [ 'NOT IN', @@ -1382,7 +1382,7 @@ protected function _default_tickets_update(EE_Event $event, array $data): array ], ], ] - ) > 0; + ) > 0; // let's just check the total price for the existing ticket and determine if it matches the new total price. // if they are different then we create a new ticket (if $ticket_sold) // if they aren't different then we go ahead and modify existing ticket. @@ -2574,8 +2574,8 @@ protected function _default_event_settings_form(): EE_Form_Section_Proper : RegStatus::PENDING_PAYMENT, 'html_label_text' => esc_html__('Default Registration Status', 'event_espresso') . EEH_Template::get_help_tab_link( - 'default_settings_status_help_tab' - ), + 'default_settings_status_help_tab' + ), 'html_help_text' => esc_html__( 'This setting allows you to preselect what the default registration status setting is when creating an event. Note that changing this setting does NOT retroactively apply it to existing events.', 'event_espresso' @@ -2588,12 +2588,12 @@ protected function _default_event_settings_form(): EE_Form_Section_Proper 'default' => $registration_config->default_maximum_number_of_tickets ?? EEM_Event::get_default_additional_limit(), 'html_label_text' => esc_html__( - 'Default Maximum Tickets Allowed Per Order:', - 'event_espresso' - ) + 'Default Maximum Tickets Allowed Per Order:', + 'event_espresso' + ) . EEH_Template::get_help_tab_link( - 'default_maximum_tickets_help_tab"' - ), + 'default_maximum_tickets_help_tab"' + ), 'html_help_text' => esc_html__( 'This setting allows you to indicate what will be the default for the maximum number of tickets per order when creating new events.', 'event_espresso' diff --git a/admin_pages/general_settings/templates/espresso_page_settings.template.php b/admin_pages/general_settings/templates/espresso_page_settings.template.php index e0f6a88d98..0a1734bae0 100644 --- a/admin_pages/general_settings/templates/espresso_page_settings.template.php +++ b/admin_pages/general_settings/templates/espresso_page_settings.template.php @@ -1,4 +1,5 @@ table{border:1px solid darkgrey;}td{vertical-align:top}'; $output .= '

' . sprintf( - __('System Information for %1$s', 'event_espresso'), - esc_url_raw(site_url()) - ) . '

'; + __('System Information for %1$s', 'event_espresso'), + esc_url_raw(site_url()) + ) . ''; $output .= EEH_Template::layout_array_as_table($status_info); echo esc_html($output); die; diff --git a/admin_pages/maintenance/templates/ee_migration_page.template.php b/admin_pages/maintenance/templates/ee_migration_page.template.php index 4995f21276..df7c9dc5e6 100644 --- a/admin_pages/maintenance/templates/ee_migration_page.template.php +++ b/admin_pages/maintenance/templates/ee_migration_page.template.php @@ -169,7 +169,9 @@ -
style="display:none"> +
style="display:none">

diff --git a/admin_pages/messages/Messages_Admin_Page.core.php b/admin_pages/messages/Messages_Admin_Page.core.php index 573e57dffa..bba9d348c0 100644 --- a/admin_pages/messages/Messages_Admin_Page.core.php +++ b/admin_pages/messages/Messages_Admin_Page.core.php @@ -19,19 +19,19 @@ */ class Messages_Admin_Page extends EE_Admin_Page { - private ?EEM_Message $MSG_MODEL = null; + private ?EEM_Message $MSG_MODEL = null; - private ?EEM_Message_Template $MTP_MODEL = null; + private ?EEM_Message_Template $MTP_MODEL = null; - private ?EEM_Message_Template_Group $MTG_MODEL = null; + private ?EEM_Message_Template_Group $MTG_MODEL = null; protected ?EE_Message_Resource_Manager $_message_resource_manager = null; - protected ?EE_Message_Template_Group $_message_template_group = null; + protected ?EE_Message_Template_Group $_message_template_group = null; - protected ?EE_messenger $_active_messenger = null; + protected ?EE_messenger $_active_messenger = null; - protected ?MessageTemplateManager $message_template_manager = null; + protected ?MessageTemplateManager $message_template_manager = null; /** @@ -42,19 +42,19 @@ class Messages_Admin_Page extends EE_Admin_Page */ protected ?EE_Messages_Template_Pack $_template_pack = null; - protected array $_active_messengers = []; + protected array $_active_messengers = []; - protected array $_active_message_types = []; + protected array $_active_message_types = []; - protected array $_shortcodes = []; + protected array $_shortcodes = []; - protected array $_m_mt_settings = []; + protected array $_m_mt_settings = []; - protected string $_active_message_type_name = ''; + protected string $_active_message_type_name = ''; - protected string $_active_messenger_name = ''; + protected string $_active_messenger_name = ''; - protected string $_context_switcher = ''; + protected string $_context_switcher = ''; /** @@ -3839,17 +3839,17 @@ protected function _setup_response_message_for_activating_messenger_with_message EE_Error::add_error( $message_type instanceof EE_message_type ? sprintf( - esc_html__( - '%s message type was not successfully activated with the %s messenger', - 'event_espresso' - ), - ucwords($message_type->label['singular']), - ucwords($messenger->label['singular']) - ) + esc_html__( + '%s message type was not successfully activated with the %s messenger', + 'event_espresso' + ), + ucwords($message_type->label['singular']), + ucwords($messenger->label['singular']) + ) : sprintf( - esc_html__('%s messenger was not successfully activated', 'event_espresso'), - ucwords($messenger->label['singular']) - ), + esc_html__('%s messenger was not successfully activated', 'event_espresso'), + ucwords($messenger->label['singular']) + ), __FILE__, __FUNCTION__, __LINE__ diff --git a/admin_pages/payments/Payments_Admin_Page.core.php b/admin_pages/payments/Payments_Admin_Page.core.php index 738d5a9c63..7a177a3ad4 100644 --- a/admin_pages/payments/Payments_Admin_Page.core.php +++ b/admin_pages/payments/Payments_Admin_Page.core.php @@ -470,9 +470,9 @@ protected function _verify_payment_method(?EE_Payment_Method $payment_method): b return $payment_method instanceof EE_Payment_Method && $payment_method->type_obj() instanceof EE_PMT_Base && $this->capabilities->current_user_can( - $payment_method->type_obj()->cap_name(), - 'specific_payment_method_type_access' - ); + $payment_method->type_obj()->cap_name(), + 'specific_payment_method_type_access' + ); } diff --git a/admin_pages/payments/templates/payment_log_details.template.php b/admin_pages/payments/templates/payment_log_details.template.php index 5a0e0ef255..b1de64537c 100644 --- a/admin_pages/payments/templates/payment_log_details.template.php +++ b/admin_pages/payments/templates/payment_log_details.template.php @@ -13,8 +13,7 @@ use EventEspresso\core\services\request\sanitizers\AllowedTags; -if ($payment_log instanceof EE_Change_Log): ?> - +if ($payment_log instanceof EE_Change_Log) : ?>

- - +
diff --git a/admin_pages/registration_form/templates/questions_main_meta_box.template.php b/admin_pages/registration_form/templates/questions_main_meta_box.template.php index 6a9b2c05f8..4a3ec1bae8 100644 --- a/admin_pages/registration_form/templates/questions_main_meta_box.template.php +++ b/admin_pages/registration_form/templates/questions_main_meta_box.template.php @@ -11,7 +11,6 @@ use EventEspresso\core\services\request\sanitizers\AllowedTags; try { - // the following are already escaped echo wp_kses( EEH_Form_Fields::hidden_input( @@ -573,7 +572,6 @@ class="" getMessage(), __FILE__, __LINE__, __METHOD__); } diff --git a/admin_pages/registrations/EE_Attendee_Contact_List_Table.class.php b/admin_pages/registrations/EE_Attendee_Contact_List_Table.class.php index 489c34d2fc..b794167a4c 100644 --- a/admin_pages/registrations/EE_Attendee_Contact_List_Table.class.php +++ b/admin_pages/registrations/EE_Attendee_Contact_List_Table.class.php @@ -294,7 +294,7 @@ class="ee-aria-tooltip" 'ee_delete_contacts', 'espresso_registrations_delete_attendees', $attendee->ID() - ) + ) && $attendee->count_related('Registration') === 0 ) { // perm delete attendee diff --git a/admin_pages/registrations/EE_Registrations_List_Table.class.php b/admin_pages/registrations/EE_Registrations_List_Table.class.php index 8e379c8a7f..4e0ee0fedf 100644 --- a/admin_pages/registrations/EE_Registrations_List_Table.class.php +++ b/admin_pages/registrations/EE_Registrations_List_Table.class.php @@ -533,10 +533,10 @@ public function column_ATT_fname(EE_Registration $registration, bool $prep_conte $group_count = ' ' . sprintf( - esc_html__('(%1$s / %2$s)', 'event_espresso'), - $registration->count(), - $registration->group_size() - ) . ' + esc_html__('(%1$s / %2$s)', 'event_espresso'), + $registration->count(), + $registration->group_size() + ) . ' '; $content = ' @@ -734,7 +734,7 @@ public function column__REG_final_price(EE_Registration $registration): string $content = $registration->final_price() > 0 ? '' . $registration->pretty_final_price() . '' : '' . esc_html__('free', 'event_espresso') . ''; - return $this->columnContent( '_REG_final_price', $content, 'end' ); + return $this->columnContent('_REG_final_price', $content, 'end'); } @@ -776,9 +776,9 @@ public function column__REG_paid(EE_Registration $registration): string $content .= ' ' . sprintf( - esc_html__('...via %s', 'event_espresso'), - $payment_method_name - ) . ' + esc_html__('...via %s', 'event_espresso'), + $payment_method_name + ) . ' '; } return $this->columnContent('_REG_paid', $content, 'end', 'stack'); @@ -1017,9 +1017,9 @@ protected function viewTransactionAction(EE_Transaction $transaction): string status_ID(), false, 'sentence') + ) . '" > '; @@ -1242,9 +1242,9 @@ protected function ticketFilterLink(EE_Ticket $ticket): string name() + ) . '" > ' . esc_html__('View Registrations', 'event_espresso') . ' diff --git a/admin_pages/registrations/Registrations_Admin_Page.core.php b/admin_pages/registrations/Registrations_Admin_Page.core.php index 2197a95578..2359fac319 100644 --- a/admin_pages/registrations/Registrations_Admin_Page.core.php +++ b/admin_pages/registrations/Registrations_Admin_Page.core.php @@ -1225,11 +1225,11 @@ private function appendAddNewRegistrationButtonToPageTitle() ) ) { $this->_admin_page_title .= ' ' . $this->get_action_link_or_button( - 'new_registration', - 'add-registrant', - ['event_id' => $EVT_ID], - 'add-new-h2' - ); + 'new_registration', + 'add-registrant', + ['event_id' => $EVT_ID], + 'add-new-h2' + ); } } @@ -3322,9 +3322,9 @@ private function convertDatetimeObjectsToStrings(array $query_params): array { foreach ($query_params as $key => $value) { if (is_array($value)) { - $query_params[$key] = $this->convertDatetimeObjectsToStrings($value); + $query_params[ $key ] = $this->convertDatetimeObjectsToStrings($value); } elseif ($value instanceof DateTime) { - $query_params[$key] = $value->format('Y-m-d H:i:s'); + $query_params[ $key ] = $value->format('Y-m-d H:i:s'); } } return $query_params; @@ -3791,7 +3791,7 @@ protected function deleteAttendees() $attendee = $this->getAttendeeModel()->get_one_by_ID($att_id); if ($attendee instanceof EE_Attendee) { $deleted = $attendee->delete_permanently(); - if($deleted) { + if ($deleted) { $success++; } } diff --git a/admin_pages/transactions/Transactions_Admin_Page.core.php b/admin_pages/transactions/Transactions_Admin_Page.core.php index 4c3f22d0fc..199c61810a 100644 --- a/admin_pages/transactions/Transactions_Admin_Page.core.php +++ b/admin_pages/transactions/Transactions_Admin_Page.core.php @@ -434,11 +434,11 @@ protected function _set_list_table_views_default() * @param Transactions_Admin_Page $this * @since 4.9.70.p */ - apply_filters( - 'FHEE__Transactions_Admin_Page___set_list_table_views_default__display_failed_txns_list', - false, - $this - ) + apply_filters( + 'FHEE__Transactions_Admin_Page___set_list_table_views_default__display_failed_txns_list', + false, + $this + ) ) { $this->_views['failed'] = [ 'slug' => 'failed', @@ -910,18 +910,18 @@ public function getActionButtons(EE_Transaction $transaction = null) && $this->_transaction->status_ID() !== EEM_Transaction::complete_status_code && $this->_transaction->status_ID() !== EEM_Transaction::overpaid_status_code ? EEH_Template::get_button_or_link( - EE_Admin_Page::add_query_args_and_nonce( - [ + EE_Admin_Page::add_query_args_and_nonce( + [ 'action' => 'send_payment_reminder', 'TXN_ID' => $this->_transaction->ID(), 'redirect_to' => 'view_transaction', - ], - TXN_ADMIN_URL - ), - esc_html__(' Send Payment Reminder', 'event_espresso'), - 'button button--secondary', - 'dashicons dashicons-email-alt' - ) + ], + TXN_ADMIN_URL + ), + esc_html__(' Send Payment Reminder', 'event_espresso'), + 'button button--secondary', + 'dashicons dashicons-email-alt' + ) : ''; } @@ -1232,11 +1232,11 @@ protected function _get_registrations_to_apply_payment_to() ], ]; $registrations_to_apply_payment_to = EEH_HTML::br() . EEH_HTML::div( - '', - 'txn-admin-apply-payment-to-registrations-dv', - '', - 'clear: both; margin: 1.5em 0 0; display: none;' - ); + '', + 'txn-admin-apply-payment-to-registrations-dv', + '', + 'clear: both; margin: 1.5em 0 0; display: none;' + ); $registrations_to_apply_payment_to .= EEH_HTML::br() . EEH_HTML::div('', '', 'admin-primary-mbox-tbl-wrap'); $registrations_to_apply_payment_to .= EEH_HTML::table('', '', 'admin-primary-mbox-tbl striped'); $registrations_to_apply_payment_to .= EEH_HTML::thead( diff --git a/admin_pages/transactions/templates/txn_admin_details_header.template.php b/admin_pages/transactions/templates/txn_admin_details_header.template.php index 24170d061b..a8bf02e8b6 100644 --- a/admin_pages/transactions/templates/txn_admin_details_header.template.php +++ b/admin_pages/transactions/templates/txn_admin_details_header.template.php @@ -41,8 +41,7 @@
- +
diff --git a/admin_pages/venues/Venues_Admin_Page.core.php b/admin_pages/venues/Venues_Admin_Page.core.php index 81db55ba6c..a047792eba 100644 --- a/admin_pages/venues/Venues_Admin_Page.core.php +++ b/admin_pages/venues/Venues_Admin_Page.core.php @@ -525,11 +525,11 @@ protected function _overview_list_table() ); $this->_admin_page_title .= ' ' . $this->get_action_link_or_button( - 'create_new', - 'add', - [], - 'add-new-h2' - ); + 'create_new', + 'add', + [], + 'add-new-h2' + ); $this->_search_btn_label = esc_html__('Venues', 'event_espresso'); $this->display_admin_list_table_page_with_sidebar(); @@ -601,9 +601,9 @@ protected function _google_map_settings() isset(EE_Registry::instance()->CFG->map_settings) && ! empty(EE_Registry::instance()->CFG->map_settings) ? (object) array_merge( - (array) $default_map_settings, - (array) EE_Registry::instance()->CFG->map_settings - ) + (array) $default_map_settings, + (array) EE_Registry::instance()->CFG->map_settings + ) : $default_map_settings; $this->_set_add_edit_form_tags('update_google_map_settings'); @@ -1326,11 +1326,11 @@ protected function _category_list_table() { do_action('AHEE_log', __FILE__, __FUNCTION__, ''); $this->_admin_page_title .= ' ' . $this->get_action_link_or_button( - 'add_category', - 'add_category', - [], - 'add-new-h2' - ); + 'add_category', + 'add_category', + [], + 'add-new-h2' + ); $this->_search_btn_label = esc_html__('Venue Categories', 'event_espresso'); $this->display_admin_list_table_page_with_sidebar(); } diff --git a/caffeinated/admin/extend/about/Extend_About_Admin_Page.core.php b/caffeinated/admin/extend/about/Extend_About_Admin_Page.core.php index f9e4d32a86..0a21f5f429 100644 --- a/caffeinated/admin/extend/about/Extend_About_Admin_Page.core.php +++ b/caffeinated/admin/extend/about/Extend_About_Admin_Page.core.php @@ -112,9 +112,9 @@ protected function _whats_new() ); $settings_message = $steps; $this->_template_args['admin_page_subtitle'] = esc_html__( - 'Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.', - 'event_espresso' - ) . $settings_message; + 'Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.', + 'event_espresso' + ) . $settings_message; $template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH . 'whats_new.template.php') ? EE_ABOUT_CAF_TEMPLATE_PATH . 'whats_new.template.php' diff --git a/caffeinated/admin/extend/events/Extend_Events_Admin_Page.core.php b/caffeinated/admin/extend/events/Extend_Events_Admin_Page.core.php index cdabbe5932..8cbb16c658 100644 --- a/caffeinated/admin/extend/events/Extend_Events_Admin_Page.core.php +++ b/caffeinated/admin/extend/events/Extend_Events_Admin_Page.core.php @@ -368,11 +368,11 @@ protected function _set_list_table_views_default() public function extra_list_table_actions(array $action_links, EE_Event $event): array { if ( - EE_Registry::instance()->CAP->current_user_can( - 'ee_read_registrations', - 'espresso_registrations_reports', - $event->ID() - ) + EE_Registry::instance()->CAP->current_user_can( + 'ee_read_registrations', + 'espresso_registrations_reports', + $event->ID() + ) ) { $reports_link = EE_Admin_Page::add_query_args_and_nonce( [ @@ -409,10 +409,10 @@ class="ee-aria-tooltip button button--icon-only" public function additional_legend_items($items) { if ( - EE_Registry::instance()->CAP->current_user_can( - 'ee_read_registrations', - 'espresso_registrations_reports' - ) + EE_Registry::instance()->CAP->current_user_can( + 'ee_read_registrations', + 'espresso_registrations_reports' + ) ) { $items['reports'] = [ 'class' => 'dashicons dashicons-chart-bar', @@ -1292,11 +1292,11 @@ protected function _delete_ticket() ]; // fail safe. If the default ticket count === 1 then we need to redirect to event overview. if ( - EEM_Ticket::instance()->count_deleted_and_undeleted( - [['TKT_is_default' => 1]], - 'TKT_ID', - true - ) + EEM_Ticket::instance()->count_deleted_and_undeleted( + [['TKT_is_default' => 1]], + 'TKT_ID', + true + ) ) { $query_args = []; } diff --git a/caffeinated/admin/extend/events/espresso_events_Events_Hooks_Extend.class.php b/caffeinated/admin/extend/events/espresso_events_Events_Hooks_Extend.class.php index a51d8b3bbe..3eea0f22b6 100644 --- a/caffeinated/admin/extend/events/espresso_events_Events_Hooks_Extend.class.php +++ b/caffeinated/admin/extend/events/espresso_events_Events_Hooks_Extend.class.php @@ -522,9 +522,9 @@ function ($ticket_data) { : '', 'TKT_description' => ! empty($ticket_data['TKT_description']) && $ticket_data['TKT_description'] !== esc_html__( - 'You can modify this description', - 'event_espresso' - ) + 'You can modify this description', + 'event_espresso' + ) ? $ticket_data['TKT_description'] : '', 'TKT_start_date' => $ticket_data['TKT_start_date'], @@ -1874,12 +1874,12 @@ protected function _get_ticket_price_row( ? 'PRICENAMEATTR' : 'edit_prices', 'price_type_selector' => $this->_get_price_type_selector( - $ticket_row, - $price_row, - $price, - $default, - $send_disabled - ), + $ticket_row, + $price_row, + $price, + $default, + $send_disabled + ), 'PRC_ID' => $default && empty($price) ? 0 : $price->ID(), diff --git a/caffeinated/admin/extend/events/templates/event_registration_options.template.php b/caffeinated/admin/extend/events/templates/event_registration_options.template.php index 4a57cc0f9e..99551bcff2 100644 --- a/caffeinated/admin/extend/events/templates/event_registration_options.template.php +++ b/caffeinated/admin/extend/events/templates/event_registration_options.template.php @@ -41,13 +41,11 @@ . '

', 'alternative_registration_page' => '

- +

', 'event_phone_number' => '

- +

', 'default_registration_status' => '

@@ -283,7 +282,6 @@ class="ee-aria-tooltip button button--small button--icon-only"
getMessage(), __FILE__, __LINE__, __METHOD__); } diff --git a/caffeinated/admin/extend/registrations/EE_Event_Registrations_List_Table.class.php b/caffeinated/admin/extend/registrations/EE_Event_Registrations_List_Table.class.php index 287e0548a4..d3959002a7 100644 --- a/caffeinated/admin/extend/registrations/EE_Event_Registrations_List_Table.class.php +++ b/caffeinated/admin/extend/registrations/EE_Event_Registrations_List_Table.class.php @@ -28,7 +28,7 @@ class EE_Event_Registrations_List_Table extends EE_Registrations_List_Table */ protected ?DatetimesForEventCheckIn $datetimes_for_current_row = null; - protected array $_status = []; + protected array $_status = []; private RegistrationsListTableFilters $filters; @@ -45,7 +45,7 @@ public function __construct($admin_page) $this->request = LoaderFactory::getLoader()->getShared(RequestInterface::class); $this->filters = new RegistrationsListTableFilters($this->request); $this->filters->resolveRequestVars(); - $this->filters->setLabel( __('Check-in Status for', 'event_espresso') ); + $this->filters->setLabel(__('Check-in Status for', 'event_espresso')); parent::__construct($admin_page); } diff --git a/caffeinated/admin/extend/registrations/Extend_EE_Registrations_List_Table.class.php b/caffeinated/admin/extend/registrations/Extend_EE_Registrations_List_Table.class.php index b9e3f9f1d0..c61458b96e 100644 --- a/caffeinated/admin/extend/registrations/Extend_EE_Registrations_List_Table.class.php +++ b/caffeinated/admin/extend/registrations/Extend_EE_Registrations_List_Table.class.php @@ -50,7 +50,7 @@ public function column_event_name(EE_Registration $registration): string $actions['event_checkins'] = $this->viewCheckinsLink($registration); return $this->columnContent( 'event_name', - $edit_event . $this->row_actions($actions) + $edit_event . $this->row_actions($actions) ); } @@ -132,9 +132,9 @@ protected function datetimeFilterLink(EE_Registration $registration, EE_Datetime name() ?: esc_attr__('this datetime', 'event_espresso'), + ) . '" > '; diff --git a/caffeinated/admin/extend/registrations/Extend_Registrations_Admin_Page.core.php b/caffeinated/admin/extend/registrations/Extend_Registrations_Admin_Page.core.php index 26b62dd1b2..56ca87cc09 100644 --- a/caffeinated/admin/extend/registrations/Extend_Registrations_Admin_Page.core.php +++ b/caffeinated/admin/extend/registrations/Extend_Registrations_Admin_Page.core.php @@ -1139,9 +1139,9 @@ private function generateListTableHeaderText(): string $header_text .= '
' . esc_html__( - 'In this view, the check-in status represents the latest check-in record for the registration in that row.', - 'event_espresso' - ) . ' + 'In this view, the check-in status represents the latest check-in record for the registration in that row.', + 'event_espresso' + ) . '
'; return $header_text; } diff --git a/caffeinated/admin/extend/registrations/RegistrationsListTableFilters.php b/caffeinated/admin/extend/registrations/RegistrationsListTableFilters.php index 1b229069b9..171ad66b70 100644 --- a/caffeinated/admin/extend/registrations/RegistrationsListTableFilters.php +++ b/caffeinated/admin/extend/registrations/RegistrationsListTableFilters.php @@ -218,10 +218,10 @@ public function getFilters(): array ' . EEH_Form_Fields::select_input( - 'DTT_ID', - $datetimes, - $this->DTT_ID - ) . ' + 'DTT_ID', + $datetimes, + $this->DTT_ID + ) . ' '; } $filters[] = ' diff --git a/caffeinated/admin/new/license_keys/License_Keys_Admin_Page.core.php b/caffeinated/admin/new/license_keys/License_Keys_Admin_Page.core.php index 5b5472aff3..5d73e00fbf 100644 --- a/caffeinated/admin/new/license_keys/License_Keys_Admin_Page.core.php +++ b/caffeinated/admin/new/license_keys/License_Keys_Admin_Page.core.php @@ -281,4 +281,3 @@ public function updateLicenseKey() ); } } - diff --git a/caffeinated/admin/new/pricing/templates/event_tickets_datetime_attached_tickets_row.template.php b/caffeinated/admin/new/pricing/templates/event_tickets_datetime_attached_tickets_row.template.php index d03a00e8e2..ee246b2292 100644 --- a/caffeinated/admin/new/pricing/templates/event_tickets_datetime_attached_tickets_row.template.php +++ b/caffeinated/admin/new/pricing/templates/event_tickets_datetime_attached_tickets_row.template.php @@ -24,7 +24,7 @@ class="datetime-tickets-edit" style=""

@@ -53,7 +53,7 @@ class="event-datetime-DTT_description ee-full-textarea-inp"

- +

@@ -63,17 +63,17 @@ class="event-datetime-DTT_description ee-full-textarea-inp"
diff --git a/core/EE_Base.core.php b/core/EE_Base.core.php index 7194b34231..e7b8555e79 100644 --- a/core/EE_Base.core.php +++ b/core/EE_Base.core.php @@ -12,8 +12,8 @@ class EE_Base { /** - * @ override magic methods - * @ return void + * override magic methods + * @return void */ public function __get($a) { diff --git a/core/EE_Capabilities.core.php b/core/EE_Capabilities.core.php index f15710b7a5..e2faf151d4 100644 --- a/core/EE_Capabilities.core.php +++ b/core/EE_Capabilities.core.php @@ -14,7 +14,6 @@ */ final class EE_Capabilities extends EE_Base { - const ROLE_ADMINISTRATOR = 'administrator'; const ROLE_EVENTS_ADMINISTRATOR = 'ee_events_administrator'; diff --git a/core/EE_Cart.core.php b/core/EE_Cart.core.php index db141f3bf2..2d0eb9db4b 100644 --- a/core/EE_Cart.core.php +++ b/core/EE_Cart.core.php @@ -8,7 +8,7 @@ * This data is used for generating the Transaction and Registrations, and the * Line Items on cart are themselves saved for creating a persistent snapshot of * what was purchased and for how much. - * @ version 2.0 + * @version 2.0 * * @version 2.0 * @subpackage includes/core/EE_Cart.core.php @@ -19,7 +19,6 @@ class EE_Cart implements ResettableInterface /** * instance of the EE_Cart object * - * @access private * @var EE_Cart $_instance */ private static $_instance; @@ -27,7 +26,6 @@ class EE_Cart implements ResettableInterface /** * instance of the EE_Session object * - * @access protected * @var EE_Session $_session */ protected $_session; @@ -51,8 +49,7 @@ class EE_Cart implements ResettableInterface /** - * @singleton method used to instantiate class object - * @access public + * singleton method used to instantiate class object * @param EE_Line_Item $grand_total * @param EE_Session $session * @return EE_Cart @@ -85,8 +82,6 @@ public static function instance(EE_Line_Item $grand_total = null, EE_Session $se /** * private constructor to prevent direct creation * - * @Constructor - * @access private * @param EE_Line_Item $grand_total * @param EE_Session $session */ @@ -156,7 +151,6 @@ public function set_grand_total_line_item(EE_Line_Item $line_item) /** * get_cart_from_reg_url_link * - * @access public * @param EE_Transaction $transaction * @param EE_Session $session * @return EE_Cart @@ -189,7 +183,6 @@ private function _create_grand_total() /** * Gets all the line items of object type Ticket * - * @access public * @return EE_Line_Item[] * @throws EE_Error * @throws ReflectionException @@ -206,7 +199,6 @@ public function get_tickets(): array /** * returns the total quantity of tickets in the cart * - * @access public * @return int * @throws EE_Error * @throws ReflectionException @@ -252,8 +244,7 @@ public function get_grand_total() /** - * @process items for adding to cart - * @access public + * process items for adding to cart * @param EE_Ticket $ticket * @param int $qty * @return bool TRUE on success, FALSE on fail @@ -270,7 +261,6 @@ public function add_ticket_to_cart(EE_Ticket $ticket, $qty = 1) /** * get_cart_total_before_tax * - * @access public * @return float * @throws EE_Error * @throws ReflectionException @@ -284,7 +274,6 @@ public function get_cart_total_before_tax() /** * gets the total amount of tax paid for items in this cart * - * @access public * @return float * @throws EE_Error * @throws ReflectionException @@ -298,7 +287,6 @@ public function get_applied_taxes() /** * Gets the total amount to be paid for the items in the cart, including taxes and other modifiers * - * @access public * @return float * @throws EE_Error * @throws ReflectionException @@ -313,7 +301,6 @@ public function get_cart_grand_total() /** * Gets the total amount to be paid for the items in the cart, including taxes and other modifiers * - * @access public * @return float * @throws EE_Error * @throws ReflectionException @@ -331,7 +318,6 @@ public function recalculate_all_cart_totals() /** * deletes an item from the cart * - * @access public * @param array|bool|string $line_item_codes * @return int on success, FALSE on fail * @throws EE_Error @@ -346,7 +332,6 @@ public function delete_items($line_item_codes = false) /** * @remove ALL items from cart and zero ALL totals - * @access public * @return bool * @throws EE_Error * @throws ReflectionException @@ -360,8 +345,7 @@ public function empty_cart() /** - * @remove ALL items from cart and delete total as well - * @access public + * remove ALL items from cart and delete total as well * @return bool * @throws EE_Error * @throws ReflectionException @@ -381,8 +365,7 @@ public function delete_cart() /** - * @save cart to session - * @access public + * save cart to session * @param bool $apply_taxes * @return bool TRUE on success, FALSE on fail * @throws EE_Error diff --git a/core/EE_Data_Mapper.core.php b/core/EE_Data_Mapper.core.php index 99bc7c492c..02933c40d1 100644 --- a/core/EE_Data_Mapper.core.php +++ b/core/EE_Data_Mapper.core.php @@ -16,8 +16,6 @@ class EE_Data_Mapper { /** * instance of the EE_Data_Mapper Object - * - * @private _instance */ private static $_instance = null; @@ -26,10 +24,8 @@ class EE_Data_Mapper /** - *private constructor to prevent direct creation + * private constructor to prevent direct creation * - * @Constructor - * @access private * @return void */ private function __construct() @@ -38,9 +34,9 @@ private function __construct() /** - *@ singleton method used to instantiate class object - *@ access public - *@ return class instance + * singleton method used to instantiate class object + * + * @return class instance */ public function &instance() { @@ -57,8 +53,9 @@ public function &instance() /** - * @ override magic methods - * @ return void + * override magic methods + * + * @return void */ final public function __destruct() { diff --git a/core/EE_Maintenance_Mode.core.php b/core/EE_Maintenance_Mode.core.php index 09c569bea3..c72a6f6427 100644 --- a/core/EE_Maintenance_Mode.core.php +++ b/core/EE_Maintenance_Mode.core.php @@ -199,7 +199,7 @@ public function level(): int public function set_maintenance_mode_if_db_old(): bool { /** @var EE_Data_Migration_Manager $data_migration_manager */ - $data_migration_manager = $this->loader->getShared(EE_Data_Migration_Manager::class ); + $data_migration_manager = $this->loader->getShared(EE_Data_Migration_Manager::class); $scripts_that_should_run = $data_migration_manager->check_for_applicable_data_migration_scripts(); if (! empty($scripts_that_should_run)) { // && $this->status !== EE_Maintenance_Mode::STATUS_FULL_SITE $this->activateFullSiteMaintenanceMode(); diff --git a/core/EE_Psr4AutoloaderInit.core.php b/core/EE_Psr4AutoloaderInit.core.php index 319622de5b..6cd694d749 100644 --- a/core/EE_Psr4AutoloaderInit.core.php +++ b/core/EE_Psr4AutoloaderInit.core.php @@ -15,7 +15,7 @@ class EE_Psr4AutoloaderInit { protected static ?Psr4Autoloader $psr4_loader = null; - private static bool $initialized = false; + private static bool $initialized = false; /** diff --git a/core/EE_Registry.core.php b/core/EE_Registry.core.php index db3ea2959a..4f67877e6e 100644 --- a/core/EE_Registry.core.php +++ b/core/EE_Registry.core.php @@ -61,7 +61,7 @@ class EE_Registry implements ResettableInterface * @since 4.5.0 * @var EE_Capabilities|null $CAP */ - public ?EE_Capabilities$CAP = null; + public ?EE_Capabilities $CAP = null; /** * @since 4.9.0 diff --git a/core/EE_System.core.php b/core/EE_System.core.php index 97024aae8b..00b484b941 100644 --- a/core/EE_System.core.php +++ b/core/EE_System.core.php @@ -657,11 +657,11 @@ private function _detect_major_version_change($activation_history): bool $previous_version_parts = explode('.', $previous_version); $current_version_parts = explode('.', espresso_version()); return isset( - $previous_version_parts[0], - $previous_version_parts[1], - $current_version_parts[0], - $current_version_parts[1] - ) && ( + $previous_version_parts[0], + $previous_version_parts[1], + $current_version_parts[0], + $current_version_parts[1] + ) && ( $previous_version_parts[0] !== $current_version_parts[0] || $previous_version_parts[1] !== $current_version_parts[1] ); diff --git a/core/admin/EE_Admin_Hooks.core.php b/core/admin/EE_Admin_Hooks.core.php index 028e4bddd8..db77d88dca 100644 --- a/core/admin/EE_Admin_Hooks.core.php +++ b/core/admin/EE_Admin_Hooks.core.php @@ -14,7 +14,6 @@ */ abstract class EE_Admin_Hooks extends EE_Base { - /** * This just holds an instance of the page object for this hook * @@ -28,9 +27,9 @@ abstract class EE_Admin_Hooks extends EE_Base * * @var EE_Admin_Page|EE_Admin_Page_CPT|null */ - protected $_adminpage_obj = null; + protected $_adminpage_obj = null; - protected ?EE_Registry $EE = null; + protected ?EE_Registry $EE = null; protected ?RequestInterface $request = null; @@ -148,7 +147,7 @@ abstract class EE_Admin_Hooks extends EE_Base /** * we're just going to use this to hold the name of the caller class (child class name) */ - public string $caller = ''; + public string $caller = ''; protected string $_current_route = ''; @@ -276,11 +275,11 @@ public function enqueue_scripts_styles() $type == 'js' ? wp_register_script($ref, $url, $depends, $version, $footer) : wp_register_style( - $ref, - $url, - $depends, - $version - ); + $ref, + $url, + $depends, + $version + ); } // k now let's do the enqueues if (! isset($this->_scripts_styles['enqueues'])) { @@ -548,9 +547,9 @@ private function _ajax_hooks() // make sure method exists if (! method_exists($this, $method)) { $msg[] = esc_html__( - 'There is no corresponding method for the hook labeled in the _ajax_func array', - 'event_espresso' - ) . '
'; + 'There is no corresponding method for the hook labeled in the _ajax_func array', + 'event_espresso' + ) . '
'; $msg[] = sprintf( esc_html__( 'The method name given in the array is %s, check the spelling and make sure it exists in the %s class', @@ -583,9 +582,9 @@ protected function _init_hooks() // make sure method exists if (! method_exists($this, $method)) { $msg[] = esc_html__( - 'There is no corresponding method for the hook labeled in the _init_func array', - 'event_espresso' - ) . '
'; + 'There is no corresponding method for the hook labeled in the _init_func array', + 'event_espresso' + ) . '
'; $msg[] = sprintf( esc_html__( 'The method name given in the array is %s, check the spelling and make sure it exists in the %s class', diff --git a/core/admin/EE_Admin_List_Table.core.php b/core/admin/EE_Admin_List_Table.core.php index 077fb4cd25..28caae2348 100644 --- a/core/admin/EE_Admin_List_Table.core.php +++ b/core/admin/EE_Admin_List_Table.core.php @@ -668,8 +668,8 @@ public function display_views() $filter .= $view['class'] ? " class='" . esc_attr($view['class']) . "'" : ''; $filter .= ">"; $filter .= '' . esc_html( - $view['label'] - ) . ''; + $view['label'] + ) . ''; $filter .= '(' . $count . ')'; $filter .= ''; $assembled_views[ $view['slug'] ] = $filter; @@ -831,7 +831,7 @@ public function extra_tablenav($which) { if ($which === 'top') { $this->_filters(); - } elseif($this->_bottom_buttons) { + } elseif ($this->_bottom_buttons) { echo '
'; foreach ($this->_bottom_buttons as $type => $action) { $route = $action['route'] ?? ''; diff --git a/core/admin/EE_Admin_Page.core.php b/core/admin/EE_Admin_Page.core.php index a14c6b02c8..6069659090 100644 --- a/core/admin/EE_Admin_Page.core.php +++ b/core/admin/EE_Admin_Page.core.php @@ -24,23 +24,23 @@ */ abstract class EE_Admin_Page extends EE_Base implements InterminableInterface { - protected ?EE_Admin_Config $admin_config = null; + protected ?EE_Admin_Config $admin_config = null; - protected ?EE_Admin_Hooks $_hook_obj = null; + protected ?EE_Admin_Hooks $_hook_obj = null; protected ?EE_Admin_List_Table $_list_table_object = null; - protected ?EE_Capabilities $capabilities = null; + protected ?EE_Capabilities $capabilities = null; - protected ?EE_Registry $EE = null; + protected ?EE_Registry $EE = null; - protected ?FeatureFlags $feature = null; + protected ?FeatureFlags $feature = null; - protected ?LoaderInterface $loader = null; + protected ?LoaderInterface $loader = null; - protected ?RequestInterface $request = null; + protected ?RequestInterface $request = null; - protected ?WP_Screen $_current_screen = null; + protected ?WP_Screen $_current_screen = null; /** * @var array @@ -104,9 +104,9 @@ abstract class EE_Admin_Page extends EE_Base implements InterminableInterface /** * flags whether the given route is a caffeinated route or not. */ - protected bool $_is_caf = false; + protected bool $_is_caf = false; - protected bool $_routing = false; + protected bool $_routing = false; /** * whether initializePage() has run @@ -124,7 +124,7 @@ abstract class EE_Admin_Page extends EE_Base implements InterminableInterface protected string $_column_template_path = ''; - protected bool $_cpt_route = false; + protected bool $_cpt_route = false; /** * set via request page and action args. @@ -184,11 +184,11 @@ abstract class EE_Admin_Page extends EE_Base implements InterminableInterface */ protected string $raw_req_page = ''; - public string $page_folder = ''; + public string $page_folder = ''; - public string $page_label = ''; + public string $page_label = ''; - public string $page_slug = ''; + public string $page_slug = ''; /** @@ -938,7 +938,7 @@ protected function _verify_routes(): bool if ( $this->_req_action === 'editpost' && ! isset($this->_page_routes['editpost']) - && isset($this->_page_routes[$alt_edit_route]) + && isset($this->_page_routes[ $alt_edit_route ]) ) { $this->_req_action = $alt_edit_route; } @@ -1459,9 +1459,9 @@ protected function _set_nav_tabs() $this->_nav_tabs[ $slug ] = [ 'url' => $config['nav']['url'] ?? EE_Admin_Page::add_query_args_and_nonce( - ['action' => $slug], - $this->_admin_base_url - ), + ['action' => $slug], + $this->_admin_base_url + ), 'link_text' => $this->navTabLabel($config['nav'], $slug), 'css_class' => $this->_req_action === $slug ? $css_class . ' nav-tab-active' : $css_class, 'order' => $config['nav']['order'] ?? $i, @@ -2357,8 +2357,8 @@ public function espresso_news_post_box() { ?>
-
- + -
- + ?> +
+
-
_template_args['admin_page_wrapper_div_class'] = str_replace( - 'event-espresso_page_espresso_', - '', - $this->_wp_page_slug - ) . ' ' . $this->_req_action . '-route'; + 'event-espresso_page_espresso_', + '', + $this->_wp_page_slug + ) . ' ' . $this->_req_action . '-route'; $template_path = $sidebar ? EE_ADMIN_TEMPLATE . 'admin_details_wrapper.template.php' @@ -2815,7 +2815,7 @@ private function _display_admin_page(bool $sidebar = false, bool $about = false) // to prevent WooCommerce from blowing things up if not using CPT global $post_type, $post; $this->_template_args['post_type'] = $post_type ?? ''; - $this->_template_args['post'] = $post ?? new WP_Post( (object) [ 'ID' => 0, 'filter' => 'raw' ] ); + $this->_template_args['post'] = $post ?? new WP_Post((object) [ 'ID' => 0, 'filter' => 'raw' ]); $this->_template_args['post_body_content'] = EEH_Template::display_template( EE_ADMIN_TEMPLATE . 'admin_details_wrapper_post_body_content.template.php', diff --git a/core/admin/EE_Admin_Page_CPT.core.php b/core/admin/EE_Admin_Page_CPT.core.php index 3683bedd9f..8b23585712 100644 --- a/core/admin/EE_Admin_Page_CPT.core.php +++ b/core/admin/EE_Admin_Page_CPT.core.php @@ -92,7 +92,7 @@ abstract class EE_Admin_Page_CPT extends EE_Admin_Page * * @var array */ - protected array $_pagenow_map= []; + protected array $_pagenow_map = []; /** @@ -440,7 +440,6 @@ public function switch_core_wp_urls_with_ours(string $good_protocol_url): string * @throws InvalidArgumentException * @throws InvalidDataTypeException * @throws InvalidInterfaceException - * @since %VER% */ private function _supports_page_templates(string $cpt_name): bool { @@ -464,7 +463,6 @@ private function _supports_page_templates(string $cpt_name): bool * Callback for the page_templates metabox selector. * * @return void - * @since %VER% */ public function page_template_meta_box() { @@ -1379,8 +1377,7 @@ protected function _create_new_cpt_item() private function loadEditorTemplate(bool $creating = true) { if ($this->admin_config && ! $this->admin_config->useAdvancedEditor()) { - add_filter('admin_body_class', function($classes) - { + add_filter('admin_body_class', function ($classes) { $classes .= ' espresso-legacy-editor'; return $classes; }); diff --git a/core/admin/EE_Admin_Page_Init.core.php b/core/admin/EE_Admin_Page_Init.core.php index fa077f4e21..c181072b72 100644 --- a/core/admin/EE_Admin_Page_Init.core.php +++ b/core/admin/EE_Admin_Page_Init.core.php @@ -21,17 +21,17 @@ abstract class EE_Admin_Page_Init extends EE_Base /** * This holds the menu map object for this admin page. */ - protected ?AdminMenuItem $_menu_map = null; + protected ?AdminMenuItem $_menu_map = null; - protected ?EE_Admin_Page $_loaded_page_object = null; + protected ?EE_Admin_Page $_loaded_page_object = null; - protected ?LoaderInterface $loader = null; + protected ?LoaderInterface $loader = null; protected ?RequestInterface $request = null; - private bool $_load_page = false; + private bool $_load_page = false; - protected bool $_routing = false; + protected bool $_routing = false; /** * Menu map has a capability. However, this allows admin pages to have separate capability requirements for menus @@ -44,7 +44,7 @@ abstract class EE_Admin_Page_Init extends EE_Base /** * identity properties (set in _set_defaults and _set_init_properties) */ - public string $label = ''; + public string $label = ''; protected string $_file_name = ''; @@ -54,14 +54,14 @@ abstract class EE_Admin_Page_Init extends EE_Base protected string $_wp_page_slug = ''; - public string $hook_file = ''; + public string $hook_file = ''; - public string $menu_slug = ''; + public string $menu_slug = ''; /** * @deprecated */ - public string $menu_label = ''; + public string $menu_label = ''; protected array $_files_hooked = []; diff --git a/core/admin/EE_Admin_Page_Loader.core.php b/core/admin/EE_Admin_Page_Loader.core.php index 7fe2649ad9..494a3907ee 100644 --- a/core/admin/EE_Admin_Page_Loader.core.php +++ b/core/admin/EE_Admin_Page_Loader.core.php @@ -131,15 +131,15 @@ private function defineCaffeinatedConstants() private function findAndLoadAdminPages() { $admin_pages = $this->findAdminPages(); - $isCaffeinated = ! (defined('EE_DECAF') && EE_DECAF) && is_dir(EE_PLUGIN_DIR_PATH . 'caffeinated/admin'); - // first let's check if there IS a caffeinated folder. - if ($isCaffeinated) { - // this just checks the caffeinated folder and takes care of setting up any caffeinated stuff. - $admin_pages = $this->findCaffeinatedAdminPages($admin_pages); - // then extensions and hooks, although they don't get added to the admin pages array - $this->findAdminPageExtensions(); - $this->findAdminPageHooks(); - } + $isCaffeinated = ! (defined('EE_DECAF') && EE_DECAF) && is_dir(EE_PLUGIN_DIR_PATH . 'caffeinated/admin'); + // first let's check if there IS a caffeinated folder. + if ($isCaffeinated) { + // this just checks the caffeinated folder and takes care of setting up any caffeinated stuff. + $admin_pages = $this->findCaffeinatedAdminPages($admin_pages); + // then extensions and hooks, although they don't get added to the admin pages array + $this->findAdminPageExtensions(); + $this->findAdminPageHooks(); + } // allow plugins to add in their own pages (note at this point they will need to have an autoloader defined for their class) OR hook into EEH_Autoloader::load_admin_page() to add their path.; // loop through admin pages and setup the $_installed_pages array. $hooks_ref = []; @@ -175,7 +175,7 @@ private function findAndLoadAdminPages() ); $hooks_ref = array_merge($hooks_ref, $extended_hooks); } - // the hooks_ref is all the pages where we have $extended _Hooks files + // the hooks_ref is all the pages where we have $extended _Hooks files // that will extend a class in a different folder. // So we want to make sure we load the file for the parent. // first make sure we've got unique values @@ -184,7 +184,7 @@ private function findAndLoadAdminPages() foreach ($hooks_ref as $path) { // if we're not caffeinated, then we don't need to do any of the following. if (! $isCaffeinated && strpos($path, 'caffeinated') !== false) { - continue; + continue; } require_once($path); } diff --git a/core/admin/templates/admin_wrapper.template.php b/core/admin/templates/admin_wrapper.template.php index a49b065ecc..fa915da4f4 100644 --- a/core/admin/templates/admin_wrapper.template.php +++ b/core/admin/templates/admin_wrapper.template.php @@ -14,15 +14,15 @@
-

- -

+

+ +

-
+
- + -
-

- -

+

+ +

-
-
+ _old_table $this->_extra_where_sql " . $wpdb->prepare( - "LIMIT %d", - $limit - ); + "LIMIT %d", + $limit + ); return $wpdb->get_results($query, ARRAY_A); } diff --git a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_answers.dmsstage.php b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_answers.dmsstage.php index 09cf6ed4cd..a1704f09c6 100644 --- a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_answers.dmsstage.php +++ b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_answers.dmsstage.php @@ -30,7 +30,6 @@ class EE_DMS_4_1_0_answers extends EE_Data_Migration_Script_Stage_Table { - private string $_new_answer_table; private string $_new_question_table; @@ -108,7 +107,7 @@ private function _insert_new_answer(array $old_answer, int $new_reg_id): void // If we don't have a mapped question_id we don't have an EE4 question to migrate this answer to. // The EE3 question may have been deleted but registration answers remain in the DB. - if(empty($new_question_id)) { + if (empty($new_question_id)) { return; } diff --git a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_attendees.dmsstage.php b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_attendees.dmsstage.php index 1a4e30f12e..1e4c9731c0 100644 --- a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_attendees.dmsstage.php +++ b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_attendees.dmsstage.php @@ -224,7 +224,6 @@ */ class EE_DMS_4_1_0_attendees extends EE_Data_Migration_Script_Stage_Table { - private string $_new_attendee_cpt_table; private string $_new_attendee_meta_table; diff --git a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_category_details.dmsstage.php b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_category_details.dmsstage.php index b24781570a..56ee761e73 100644 --- a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_category_details.dmsstage.php +++ b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_category_details.dmsstage.php @@ -7,7 +7,6 @@ */ class EE_DMS_4_1_0_category_details extends EE_Data_Migration_Script_Stage { - private string $_new_term_table; diff --git a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_checkins.dmsstage.php b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_checkins.dmsstage.php index e2cd7575b1..d6344d2016 100644 --- a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_checkins.dmsstage.php +++ b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_checkins.dmsstage.php @@ -26,7 +26,6 @@ class EE_DMS_4_1_0_checkins extends EE_Data_Migration_Script_Stage_Table { - public function __construct() { global $wpdb; diff --git a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_event_category.dmsstage.php b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_event_category.dmsstage.php index 2973d55712..b07885db96 100644 --- a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_event_category.dmsstage.php +++ b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_event_category.dmsstage.php @@ -26,7 +26,6 @@ */ class EE_DMS_4_1_0_event_category extends EE_Data_Migration_Script_Stage { - /** * @throws EE_Error */ diff --git a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_event_question_group.dmsstage.php b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_event_question_group.dmsstage.php index 092c542d07..918fa41480 100644 --- a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_event_question_group.dmsstage.php +++ b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_event_question_group.dmsstage.php @@ -20,7 +20,6 @@ */ class EE_DMS_4_1_0_event_question_group extends EE_Data_Migration_Script_Stage_Table { - /** * @throws EE_Error */ diff --git a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_event_venue.dmsstage.php b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_event_venue.dmsstage.php index cb5e0f15c5..6b3db5e2fc 100644 --- a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_event_venue.dmsstage.php +++ b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_event_venue.dmsstage.php @@ -26,7 +26,6 @@ */ class EE_DMS_4_1_0_event_venue extends EE_Data_Migration_Script_Stage { - /** * @throws EE_Error */ diff --git a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_events.dmsstage.php b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_events.dmsstage.php index 70cf38010b..4391a6ed34 100644 --- a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_events.dmsstage.php +++ b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_events.dmsstage.php @@ -176,7 +176,6 @@ */ class EE_DMS_4_1_0_events extends EE_Data_Migration_Script_Stage { - private string $_old_start_end_table; private string $_new_meta_table; @@ -607,7 +606,7 @@ private function _maybe_create_venue($old_event): int if ($new_id) { $this->_insert_venue_into_meta_table($new_id, $old_event); $guid = $old_event['venue_image'] ?? null; - if($guid) { + if ($guid) { $this->get_migration_script()->convert_image_url_to_attachment_and_attach_to_post( $guid, $new_id, diff --git a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_gateways.dmsstage.php b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_gateways.dmsstage.php index 2cd77a5184..fd4eea09e6 100644 --- a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_gateways.dmsstage.php +++ b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_gateways.dmsstage.php @@ -14,7 +14,6 @@ */ class EE_DMS_4_1_0_gateways extends EE_Data_Migration_Script_Stage { - private bool $_converted_active_gateways = false; protected array $_gateways_we_know_how_to_migrate = [ diff --git a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_line_items.dmsstage.php b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_line_items.dmsstage.php index a53483fac4..caaae34e82 100644 --- a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_line_items.dmsstage.php +++ b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_line_items.dmsstage.php @@ -44,7 +44,6 @@ */ class EE_DMS_4_1_0_line_items extends EE_Data_Migration_Script_Stage_Table { - private string $_new_line_table; private string $_new_transaction_table; diff --git a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_org_options.dmsstage.php b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_org_options.dmsstage.php index 78381d7c5c..735408c71c 100644 --- a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_org_options.dmsstage.php +++ b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_org_options.dmsstage.php @@ -89,7 +89,6 @@ */ class EE_DMS_4_1_0_org_options extends EE_Data_Migration_Script_Stage { - public function __construct() { $this->_pretty_name = esc_html__("Organization Options/Config", "event_espresso"); diff --git a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_prices.dmsstage.php b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_prices.dmsstage.php index db05408030..f5bcc4a8af 100644 --- a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_prices.dmsstage.php +++ b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_prices.dmsstage.php @@ -107,7 +107,6 @@ */ class EE_DMS_4_1_0_prices extends EE_Data_Migration_Script_Stage_Table { - const price_type_base = 1; const price_type_member_discount = 3; @@ -178,12 +177,18 @@ protected function _migrate_old_row($old_row) if (floatval($old_row['surcharge']) >= 0.01) { $surcharge_price_id = $this->_insert_new_surcharge_price($old_row); $this->get_migration_script()->set_mapping( - $this->_old_table, $old_row['id'], $this->_new_price_table, [$new_price_id, $surcharge_price_id] + $this->_old_table, + $old_row['id'], + $this->_new_price_table, + [$new_price_id, $surcharge_price_id] ); } else { $surcharge_price_id = 0; $this->get_migration_script()->set_mapping( - $this->_old_table, $old_row['id'], $this->_new_price_table, [$new_price_id] + $this->_old_table, + $old_row['id'], + $this->_new_price_table, + [$new_price_id] ); } // associate the ticket to all datetimes for event (ie, this ONE ticket grants access to ALL datetimes, not just one of the attendee's choice. diff --git a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_question_group_question.dmsstage.php b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_question_group_question.dmsstage.php index 57f127796b..62e7d7c42d 100644 --- a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_question_group_question.dmsstage.php +++ b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_question_group_question.dmsstage.php @@ -27,7 +27,6 @@ */ class EE_DMS_4_1_0_question_group_question extends EE_Data_Migration_Script_Stage { - public function __construct() { global $wpdb; diff --git a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_question_groups.dmsstage.php b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_question_groups.dmsstage.php index c2d4ac4879..eed70f2f6e 100644 --- a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_question_groups.dmsstage.php +++ b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_question_groups.dmsstage.php @@ -45,7 +45,6 @@ */ class EE_DMS_4_1_0_question_groups extends EE_Data_Migration_Script_Stage { - public function __construct() { global $wpdb; diff --git a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_questions.dmsstage.php b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_questions.dmsstage.php index 2dab2a550c..e863180584 100644 --- a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_questions.dmsstage.php +++ b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_questions.dmsstage.php @@ -66,7 +66,6 @@ */ class EE_DMS_4_1_0_questions extends EE_Data_Migration_Script_Stage { - private string $_option_table; diff --git a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_shortcodes.dmsstage.php b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_shortcodes.dmsstage.php index d0ab3ca4e6..f3ddfd945c 100644 --- a/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_shortcodes.dmsstage.php +++ b/core/data_migration_scripts/4_1_0_stages/EE_DMS_4_1_0_shortcodes.dmsstage.php @@ -6,7 +6,6 @@ class EE_DMS_4_1_0_shortcodes extends EE_Data_Migration_Script_Stage { - public function __construct() { global $wpdb; diff --git a/core/data_migration_scripts/4_2_0_stages/EE_DMS_4_2_0_datetime_fields.dmsstage.php b/core/data_migration_scripts/4_2_0_stages/EE_DMS_4_2_0_datetime_fields.dmsstage.php index 01dbb89cc9..3701cf2ca1 100644 --- a/core/data_migration_scripts/4_2_0_stages/EE_DMS_4_2_0_datetime_fields.dmsstage.php +++ b/core/data_migration_scripts/4_2_0_stages/EE_DMS_4_2_0_datetime_fields.dmsstage.php @@ -8,7 +8,6 @@ class EE_DMS_4_2_0_datetime_fields extends EE_Data_Migration_Script_Stage_Table { - public function __construct() { global $wpdb; @@ -25,15 +24,19 @@ protected function _migrate_old_row($old_row) global $wpdb; $updated = $wpdb->update( - $this->_old_table, [ + $this->_old_table, + [ 'DTT_name' => '', 'DTT_description' => '', - ], [ + ], + [ 'DTT_ID' => $old_row['DTT_ID'], - ], [ + ], + [ '%s',// DTT_name, '%s',// DTT_description - ], [ + ], + [ '%d',// DTT_ID ] ); diff --git a/core/data_migration_scripts/4_2_0_stages/EE_DMS_4_2_0_question_group_questions.dmsstage.php b/core/data_migration_scripts/4_2_0_stages/EE_DMS_4_2_0_question_group_questions.dmsstage.php index 651f4619fa..0a72e136e3 100644 --- a/core/data_migration_scripts/4_2_0_stages/EE_DMS_4_2_0_question_group_questions.dmsstage.php +++ b/core/data_migration_scripts/4_2_0_stages/EE_DMS_4_2_0_question_group_questions.dmsstage.php @@ -6,7 +6,6 @@ class EE_DMS_4_2_0_question_group_questions extends EE_Data_Migration_Script_Stage_Table { - private string $_qgq_table; @@ -26,8 +25,11 @@ protected function _migrate_old_row($old_row) // QSG_order equal to this question's QST_order global $wpdb; $updated = $wpdb->update( - $this->_qgq_table, ['QGQ_order' => $old_row['QST_order']], ['QST_ID' => $old_row['QST_ID']], ['%d'], - // QGQ_order + $this->_qgq_table, + ['QGQ_order' => $old_row['QST_order']], + ['QST_ID' => $old_row['QST_ID']], + ['%d'], + // QGQ_order ['%d'] // QST_ID ); if (false === $updated) { diff --git a/core/data_migration_scripts/4_3_0_stages/EE_DMS_4_3_0_event_message_templates.dmsstage.php b/core/data_migration_scripts/4_3_0_stages/EE_DMS_4_3_0_event_message_templates.dmsstage.php index 9c646d190e..f5000d28ed 100644 --- a/core/data_migration_scripts/4_3_0_stages/EE_DMS_4_3_0_event_message_templates.dmsstage.php +++ b/core/data_migration_scripts/4_3_0_stages/EE_DMS_4_3_0_event_message_templates.dmsstage.php @@ -12,7 +12,6 @@ */ class EE_DMS_4_3_0_event_message_templates extends EE_Data_Migration_Script_Stage_Table { - /** * This property will hold the table name for event_message_templates * @@ -38,13 +37,13 @@ protected function _migrate_old_row($old_row) if ($old_row['EVT_ID'] > 0) { // let's get the EVT for this id so we can update the custom name on the old row. $event_name = 'Custom Template for ' . $wpdb->get_var( - $wpdb->prepare( - "SELECT post_title from $wpdb->posts WHERE ID = %d", - absint( - $old_row['EVT_ID'] - ) + $wpdb->prepare( + "SELECT post_title from $wpdb->posts WHERE ID = %d", + absint( + $old_row['EVT_ID'] ) - ); + ) + ); // update name $updated = $wpdb->update( diff --git a/core/data_migration_scripts/4_3_0_stages/EE_DMS_4_3_0_question_option_order.dmsstage.php b/core/data_migration_scripts/4_3_0_stages/EE_DMS_4_3_0_question_option_order.dmsstage.php index efb4e9eba9..33b04640fd 100644 --- a/core/data_migration_scripts/4_3_0_stages/EE_DMS_4_3_0_question_option_order.dmsstage.php +++ b/core/data_migration_scripts/4_3_0_stages/EE_DMS_4_3_0_question_option_order.dmsstage.php @@ -7,7 +7,6 @@ class EE_DMS_4_3_0_question_option_order extends EE_Data_Migration_Script_Stage_Table { - public function __construct() { global $wpdb; diff --git a/core/data_migration_scripts/4_5_0_stages/EE_DMS_4_5_0_invoice_settings.dmsstage.php b/core/data_migration_scripts/4_5_0_stages/EE_DMS_4_5_0_invoice_settings.dmsstage.php index b1f76fb221..c8791b85d1 100644 --- a/core/data_migration_scripts/4_5_0_stages/EE_DMS_4_5_0_invoice_settings.dmsstage.php +++ b/core/data_migration_scripts/4_5_0_stages/EE_DMS_4_5_0_invoice_settings.dmsstage.php @@ -14,7 +14,6 @@ */ class EE_DMS_4_5_0_invoice_settings extends EE_Data_Migration_Script_Stage { - /** * Just initializes the status of the migration */ @@ -114,10 +113,12 @@ protected function _migration_step($num_items_to_migrate = 1) ); if ($overridden_invoice_body || $overridden_receipt_body) { new PersistentAdminNotice( - 'invoice_overriding_templates', esc_html__( - 'Note: in this version of Event Espresso, PDF and HTML Invoices and Receipts are now Messages and can be changed just like any other messages; however we noticed you had previously overridden the old default Invoice/Receipt templates. Because of this, your old Invoice/Receipt templates will continue to be used INSTEAD of the new Invoice/Receipt message equivalents. We recommend deleting your old Invoice/Receipt templates and modifying the new Invoice and Receipt messages\'s content in Messages -> Invoice and Messages -> Receipt.', - 'event_espresso' - ), true + 'invoice_overriding_templates', + esc_html__( + 'Note: in this version of Event Espresso, PDF and HTML Invoices and Receipts are now Messages and can be changed just like any other messages; however we noticed you had previously overridden the old default Invoice/Receipt templates. Because of this, your old Invoice/Receipt templates will continue to be used INSTEAD of the new Invoice/Receipt message equivalents. We recommend deleting your old Invoice/Receipt templates and modifying the new Invoice and Receipt messages\'s content in Messages -> Invoice and Messages -> Receipt.', + 'event_espresso' + ), + true ); } } diff --git a/core/data_migration_scripts/4_5_0_stages/EE_DMS_4_5_0_update_wp_user_for_price_types.dmsstage.php b/core/data_migration_scripts/4_5_0_stages/EE_DMS_4_5_0_update_wp_user_for_price_types.dmsstage.php index 0a4de200f5..fa502994b0 100644 --- a/core/data_migration_scripts/4_5_0_stages/EE_DMS_4_5_0_update_wp_user_for_price_types.dmsstage.php +++ b/core/data_migration_scripts/4_5_0_stages/EE_DMS_4_5_0_update_wp_user_for_price_types.dmsstage.php @@ -10,7 +10,6 @@ */ class EE_DMS_4_5_0_update_wp_user_for_price_types extends EE_Data_Migration_Script_Stage_Table { - public function __construct() { global $wpdb; diff --git a/core/data_migration_scripts/4_5_0_stages/EE_DMS_4_5_0_update_wp_user_for_prices.dmsstage.php b/core/data_migration_scripts/4_5_0_stages/EE_DMS_4_5_0_update_wp_user_for_prices.dmsstage.php index 41df93d194..2904498299 100644 --- a/core/data_migration_scripts/4_5_0_stages/EE_DMS_4_5_0_update_wp_user_for_prices.dmsstage.php +++ b/core/data_migration_scripts/4_5_0_stages/EE_DMS_4_5_0_update_wp_user_for_prices.dmsstage.php @@ -10,7 +10,6 @@ */ class EE_DMS_4_5_0_update_wp_user_for_prices extends EE_Data_Migration_Script_Stage_Table { - public function __construct() { global $wpdb; @@ -34,7 +33,7 @@ protected function _migrate_old_row($old_row) $this->_old_table, ['PRC_wp_user' => $user_id], ['PRC_ID' => $old_row['PRC_ID']], - ['%d'],// PRC_wp_user + ['%d'], // PRC_wp_user ['%d'] // PRC_ID ); if (false === $updated) { diff --git a/core/data_migration_scripts/4_5_0_stages/EE_DMS_4_5_0_update_wp_user_for_question_groups.dmsstage.php b/core/data_migration_scripts/4_5_0_stages/EE_DMS_4_5_0_update_wp_user_for_question_groups.dmsstage.php index 70c9951be3..248520cc73 100644 --- a/core/data_migration_scripts/4_5_0_stages/EE_DMS_4_5_0_update_wp_user_for_question_groups.dmsstage.php +++ b/core/data_migration_scripts/4_5_0_stages/EE_DMS_4_5_0_update_wp_user_for_question_groups.dmsstage.php @@ -10,7 +10,6 @@ */ class EE_DMS_4_5_0_update_wp_user_for_question_groups extends EE_Data_Migration_Script_Stage_Table { - public function __construct() { global $wpdb; diff --git a/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_billing_info.dmsstage.php b/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_billing_info.dmsstage.php index a3df312db9..ac12b6ff16 100644 --- a/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_billing_info.dmsstage.php +++ b/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_billing_info.dmsstage.php @@ -9,7 +9,6 @@ */ class EE_DMS_4_6_0_billing_info extends EE_Data_Migration_Script_Stage_Table { - public function __construct() { global $wpdb; diff --git a/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_country_system_question.dmsstage.php b/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_country_system_question.dmsstage.php index 937938055e..0105baeb52 100644 --- a/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_country_system_question.dmsstage.php +++ b/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_country_system_question.dmsstage.php @@ -9,7 +9,6 @@ */ class EE_DMS_4_6_0_country_system_question extends EE_Data_Migration_Script_Stage_Table { - public function __construct() { global $wpdb; diff --git a/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_gateways.dmsstage.php b/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_gateways.dmsstage.php index 34f79b3719..4a82caa5ed 100644 --- a/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_gateways.dmsstage.php +++ b/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_gateways.dmsstage.php @@ -11,7 +11,6 @@ */ class EE_DMS_4_6_0_gateways extends EE_Data_Migration_Script_Stage { - protected string $_new_table_name; protected string $_extra_meta_table_name; diff --git a/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_invoice_settings.dmsstage.php b/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_invoice_settings.dmsstage.php index 910cb8ae6c..4ed8e34485 100644 --- a/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_invoice_settings.dmsstage.php +++ b/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_invoice_settings.dmsstage.php @@ -12,7 +12,6 @@ */ class EE_DMS_4_6_0_invoice_settings extends EE_Data_Migration_Script_Stage { - /** * Just initializes the status of the migration */ diff --git a/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_payments.dmsstage.php b/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_payments.dmsstage.php index 18da0b10b4..a7706204c1 100644 --- a/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_payments.dmsstage.php +++ b/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_payments.dmsstage.php @@ -9,7 +9,6 @@ */ class EE_DMS_4_6_0_payments extends EE_Data_Migration_Script_Stage_Table { - protected string $_payment_method_table; diff --git a/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_question_types.dmsstage.php b/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_question_types.dmsstage.php index b277c03905..2bc58227b5 100644 --- a/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_question_types.dmsstage.php +++ b/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_question_types.dmsstage.php @@ -9,7 +9,6 @@ */ class EE_DMS_4_6_0_question_types extends EE_Data_Migration_Script_Stage_Table { - protected array $_question_type_conversions = []; diff --git a/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_state_system_question.dmsstage.php b/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_state_system_question.dmsstage.php index ce77156ce7..06925542c2 100644 --- a/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_state_system_question.dmsstage.php +++ b/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_state_system_question.dmsstage.php @@ -9,7 +9,6 @@ */ class EE_DMS_4_6_0_state_system_question extends EE_Data_Migration_Script_Stage_Table { - public function __construct() { global $wpdb; diff --git a/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_transactions.dmsstage.php b/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_transactions.dmsstage.php index 3d0c8f0301..8fe4e8e755 100644 --- a/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_transactions.dmsstage.php +++ b/core/data_migration_scripts/4_6_0_stages/EE_DMS_4_6_0_transactions.dmsstage.php @@ -9,7 +9,6 @@ */ class EE_DMS_4_6_0_transactions extends EE_Data_Migration_Script_Stage_Table { - protected string $_transaction_table; protected string $_payment_method_table; diff --git a/core/data_migration_scripts/4_7_0_stages/EE_DMS_4_7_0_Add_Taxes_To_REG_Final_Price.dmsstage.php b/core/data_migration_scripts/4_7_0_stages/EE_DMS_4_7_0_Add_Taxes_To_REG_Final_Price.dmsstage.php index 01c921eb68..25b01ca638 100644 --- a/core/data_migration_scripts/4_7_0_stages/EE_DMS_4_7_0_Add_Taxes_To_REG_Final_Price.dmsstage.php +++ b/core/data_migration_scripts/4_7_0_stages/EE_DMS_4_7_0_Add_Taxes_To_REG_Final_Price.dmsstage.php @@ -9,7 +9,6 @@ */ class EE_DMS_4_7_0_Add_Taxes_To_REG_Final_Price extends EE_Data_Migration_Script_Stage_Table { - protected string $_ticket_table; protected string $_line_item_table; diff --git a/core/data_migration_scripts/4_7_0_stages/EE_DMS_4_7_0_Registration_Payments.dmsstage.php b/core/data_migration_scripts/4_7_0_stages/EE_DMS_4_7_0_Registration_Payments.dmsstage.php index aec1af2cfc..be512361d7 100644 --- a/core/data_migration_scripts/4_7_0_stages/EE_DMS_4_7_0_Registration_Payments.dmsstage.php +++ b/core/data_migration_scripts/4_7_0_stages/EE_DMS_4_7_0_Registration_Payments.dmsstage.php @@ -9,7 +9,6 @@ */ class EE_DMS_4_7_0_Registration_Payments extends EE_Data_Migration_Script_Stage_Table { - protected string $_payment_table; protected string $_registration_table; diff --git a/core/data_migration_scripts/4_8_0_stages/EE_DMS_4_8_0_event_subtotals.dmsstage.php b/core/data_migration_scripts/4_8_0_stages/EE_DMS_4_8_0_event_subtotals.dmsstage.php index 1aeb245c5c..35f91a7772 100644 --- a/core/data_migration_scripts/4_8_0_stages/EE_DMS_4_8_0_event_subtotals.dmsstage.php +++ b/core/data_migration_scripts/4_8_0_stages/EE_DMS_4_8_0_event_subtotals.dmsstage.php @@ -9,7 +9,6 @@ */ class EE_DMS_4_8_0_event_subtotals extends EE_Data_Migration_Script_Stage_Table { - public function __construct() { global $wpdb; diff --git a/core/data_migration_scripts/4_9_0_stages/EE_DMS_4_9_0_Answers_With_No_Registration.dmsstage.php b/core/data_migration_scripts/4_9_0_stages/EE_DMS_4_9_0_Answers_With_No_Registration.dmsstage.php index 829a50eacc..1cd6946ca7 100644 --- a/core/data_migration_scripts/4_9_0_stages/EE_DMS_4_9_0_Answers_With_No_Registration.dmsstage.php +++ b/core/data_migration_scripts/4_9_0_stages/EE_DMS_4_9_0_Answers_With_No_Registration.dmsstage.php @@ -10,7 +10,6 @@ */ class EE_DMS_4_9_0_Answers_With_No_Registration extends EE_Data_Migration_Script_Stage { - public function __construct() { $this->_pretty_name = esc_html__('Answer Cleanup', 'event_espresso'); diff --git a/core/data_migration_scripts/EE_DMS_Core_4_10_0.dms.php b/core/data_migration_scripts/EE_DMS_Core_4_10_0.dms.php index b75bfbc8b3..8abe8457f2 100644 --- a/core/data_migration_scripts/EE_DMS_Core_4_10_0.dms.php +++ b/core/data_migration_scripts/EE_DMS_Core_4_10_0.dms.php @@ -31,7 +31,6 @@ */ class EE_DMS_Core_4_10_0 extends EE_Data_Migration_Script_Base { - /** * @param TableManager|null $table_manager * @param TableAnalysis|null $table_analysis diff --git a/core/data_migration_scripts/EE_DMS_Core_4_1_0.dms.php b/core/data_migration_scripts/EE_DMS_Core_4_1_0.dms.php index 5cf82a8f18..554b9be468 100644 --- a/core/data_migration_scripts/EE_DMS_Core_4_1_0.dms.php +++ b/core/data_migration_scripts/EE_DMS_Core_4_1_0.dms.php @@ -38,7 +38,6 @@ */ class EE_DMS_Core_4_1_0 extends EE_Data_Migration_Script_Base { - /** * EE_DMS_Core_4_1_0 constructor. * diff --git a/core/data_migration_scripts/EE_DMS_Core_4_2_0.dms.php b/core/data_migration_scripts/EE_DMS_Core_4_2_0.dms.php index ce447b8944..91e5ba2856 100644 --- a/core/data_migration_scripts/EE_DMS_Core_4_2_0.dms.php +++ b/core/data_migration_scripts/EE_DMS_Core_4_2_0.dms.php @@ -32,7 +32,6 @@ */ class EE_DMS_Core_4_2_0 extends EE_Data_Migration_Script_Base { - /** * EE_DMS_Core_4_2_0 constructor. * diff --git a/core/data_migration_scripts/EE_DMS_Core_4_3_0.dms.php b/core/data_migration_scripts/EE_DMS_Core_4_3_0.dms.php index 801f5ff1bd..9dc4390f4c 100644 --- a/core/data_migration_scripts/EE_DMS_Core_4_3_0.dms.php +++ b/core/data_migration_scripts/EE_DMS_Core_4_3_0.dms.php @@ -30,7 +30,6 @@ */ class EE_DMS_Core_4_3_0 extends EE_Data_Migration_Script_Base { - /** * EE_DMS_Core_4_3_0 constructor. * diff --git a/core/data_migration_scripts/EE_DMS_Core_4_5_0.dms.php b/core/data_migration_scripts/EE_DMS_Core_4_5_0.dms.php index bee11f90e8..f5fa0fc4c5 100644 --- a/core/data_migration_scripts/EE_DMS_Core_4_5_0.dms.php +++ b/core/data_migration_scripts/EE_DMS_Core_4_5_0.dms.php @@ -30,7 +30,6 @@ */ class EE_DMS_Core_4_5_0 extends EE_Data_Migration_Script_Base { - /** * EE_DMS_Core_4_5_0 constructor. * diff --git a/core/data_migration_scripts/EE_DMS_Core_4_6_0.dms.php b/core/data_migration_scripts/EE_DMS_Core_4_6_0.dms.php index 60f30c96fb..0adefe5388 100644 --- a/core/data_migration_scripts/EE_DMS_Core_4_6_0.dms.php +++ b/core/data_migration_scripts/EE_DMS_Core_4_6_0.dms.php @@ -32,7 +32,6 @@ */ class EE_DMS_Core_4_6_0 extends EE_Data_Migration_Script_Base { - /** * return EE_DMS_Core_4_6_0 * diff --git a/core/data_migration_scripts/EE_DMS_Core_4_7_0.dms.php b/core/data_migration_scripts/EE_DMS_Core_4_7_0.dms.php index 200b466806..6427891efb 100644 --- a/core/data_migration_scripts/EE_DMS_Core_4_7_0.dms.php +++ b/core/data_migration_scripts/EE_DMS_Core_4_7_0.dms.php @@ -34,7 +34,6 @@ */ class EE_DMS_Core_4_7_0 extends EE_Data_Migration_Script_Base { - /** * return EE_DMS_Core_4_7_0 * diff --git a/core/data_migration_scripts/EE_DMS_Core_4_8_0.dms.php b/core/data_migration_scripts/EE_DMS_Core_4_8_0.dms.php index f307b8278f..2778b27e8a 100644 --- a/core/data_migration_scripts/EE_DMS_Core_4_8_0.dms.php +++ b/core/data_migration_scripts/EE_DMS_Core_4_8_0.dms.php @@ -34,7 +34,6 @@ */ class EE_DMS_Core_4_8_0 extends EE_Data_Migration_Script_Base { - /** * return EE_DMS_Core_4_8_0 * diff --git a/core/data_migration_scripts/EE_DMS_Core_4_9_0.dms.php b/core/data_migration_scripts/EE_DMS_Core_4_9_0.dms.php index ea5d7f0a7f..53bc5f4912 100644 --- a/core/data_migration_scripts/EE_DMS_Core_4_9_0.dms.php +++ b/core/data_migration_scripts/EE_DMS_Core_4_9_0.dms.php @@ -32,7 +32,6 @@ */ class EE_DMS_Core_4_9_0 extends EE_Data_Migration_Script_Base { - /** * return EE_DMS_Core_4_9_0 * diff --git a/core/data_migration_scripts/EE_DMS_Unknown_1_0_0.core.php b/core/data_migration_scripts/EE_DMS_Unknown_1_0_0.core.php index 04c849b702..5ef89cd18f 100644 --- a/core/data_migration_scripts/EE_DMS_Unknown_1_0_0.core.php +++ b/core/data_migration_scripts/EE_DMS_Unknown_1_0_0.core.php @@ -15,7 +15,6 @@ */ class EE_DMS_Unknown_1_0_0 extends EE_Data_Migration_Script_Base { - /** * Returns whether this data migration script can operate on the given version of the database. * Eg, if this migration script can migrate from 3.1.26 or higher (but not anything after 4.0.0), and diff --git a/core/data_migration_scripts/EE_Data_Migration_Script_Stage.core.php b/core/data_migration_scripts/EE_Data_Migration_Script_Stage.core.php index 453341c5e1..2da6386893 100644 --- a/core/data_migration_scripts/EE_Data_Migration_Script_Stage.core.php +++ b/core/data_migration_scripts/EE_Data_Migration_Script_Stage.core.php @@ -29,7 +29,6 @@ */ abstract class EE_Data_Migration_Script_Stage extends EE_Data_Migration_Class_Base { - /** * The migration script this is a stage of * diff --git a/core/db_classes/EE_Attendee.class.php b/core/db_classes/EE_Attendee.class.php index b0bcc86f87..3842535f4e 100644 --- a/core/db_classes/EE_Attendee.class.php +++ b/core/db_classes/EE_Attendee.class.php @@ -615,6 +615,9 @@ public function billing_info_for_payment_method(EE_Payment_Method $payment_metho return null; } $billing_form = $pm_type->billing_form(); + if (! $billing_form instanceof EE_Billing_Info_Form) { + return null; + } // double-check the form isn't totally hidden, in which case pretend there is no form $form_totally_hidden = true; foreach ($billing_form->inputs_in_subsections() as $input) { diff --git a/core/db_classes/EE_Base_Class.class.php b/core/db_classes/EE_Base_Class.class.php index 9352075388..7e567c0552 100644 --- a/core/db_classes/EE_Base_Class.class.php +++ b/core/db_classes/EE_Base_Class.class.php @@ -15,7 +15,6 @@ */ abstract class EE_Base_Class { - /** * @var EEM_Base|null */ @@ -3377,8 +3376,8 @@ private function echoProperty($field, $value, int $indent = 0) $value = get_object_vars($value); } if (is_array($value)) { - foreach ($value as $f => $v ) { - $this->echoProperty($f, $v, $indent+1); + foreach ($value as $f => $v) { + $this->echoProperty($f, $v, $indent + 1); } return; } diff --git a/core/db_classes/EE_CSV.class.php b/core/db_classes/EE_CSV.class.php index b07da8828d..d604c332d3 100644 --- a/core/db_classes/EE_CSV.class.php +++ b/core/db_classes/EE_CSV.class.php @@ -24,7 +24,6 @@ class EE_CSV private $_primary_keys; /** - * * @var EE_Registry */ private $EE; @@ -34,10 +33,8 @@ class EE_CSV const metadata_header = 'Event Espresso Export Meta Data'; /** - * private constructor to prevent direct creation + * private constructor to prevent direct creation * - * @Constructor - * @access private * @return void */ private function __construct() @@ -75,8 +72,7 @@ private function __construct() /** - * @ singleton method used to instantiate class object - * @ access public + * singleton method used to instantiate class object * * @return EE_CSV */ @@ -90,8 +86,8 @@ public static function instance() } /** - * Opens a unicode or utf file (normal file_get_contents has difficulty readin ga unicode file. @see - * http://stackoverflow.com/questions/15092764/how-to-read-unicode-text-file-in-php + * Opens a unicode or utf file (normal file_get_contents has difficulty reading ga unicode file) + * @see http://stackoverflow.com/questions/15092764/how-to-read-unicode-text-file-in-php * * @param string $file_path * @return string @@ -174,8 +170,7 @@ public function import_csv_to_multi_dimensional_array($path_to_file) /** - * @Import contents of csv file and store values in an array to be manipulated by other functions - * @access public + * Import contents of csv file and store values in an array to be manipulated by other functions * @param string $path_to_file - the csv file to be imported including the path to it's location. * If $model_name is provided, assumes that each row in the CSV represents a * model object for that model If $model_name ISN'T provided, assumes that @@ -530,8 +525,7 @@ public function export_multiple_model_data_to_csv($filename, $model_data_array) } /** - * @Export contents of an array to csv file - * @access public + * Export contents of an array to csv file * @param array $data - the array of data to be converted to csv and exported * @param string $filename - name for newly created csv file * @return TRUE on success, FALSE on fail @@ -563,8 +557,7 @@ public function export_array_to_csv($data = false, $filename = false) /** - * @Determine the maximum upload file size based on php.ini settings - * @access public + * Determine the maximum upload file size based on php.ini settings * @param int $percent_of_max - desired percentage of the max upload_mb * @return int KB */ @@ -597,8 +590,7 @@ public function get_max_upload_size($percent_of_max = false) /** - * @Drop in replacement for PHP's fputcsv function - but this one works!!! - * @access private + * Drop in replacement for PHP's fputcsv function - but this one works!!! * @param resource $fh - file handle - what we are writing to * @param array $row - individual row of csv data * @param string $delimiter - csv delimiter @@ -635,8 +627,7 @@ private function fputcsv2($fh, array $row, $delimiter = ',', $enclosure = '"', $ // /** - // * @CSV Import / Export messages - // * @access public + // * CSV Import / Export messages // * @return void // */ // public function csv_admin_notices() diff --git a/core/db_classes/EE_Datetime.class.php b/core/db_classes/EE_Datetime.class.php index d56bd21245..254c074910 100644 --- a/core/db_classes/EE_Datetime.class.php +++ b/core/db_classes/EE_Datetime.class.php @@ -1366,7 +1366,7 @@ public function remove_venue($venue_id_or_obj): EE_Venue public function venue_ID(array $query_params = []): int { // If no $query_params have been passed, use the VNU_ID assigned to the Datetime itself - if (empty($query_params)){ + if (empty($query_params)) { return (int) $this->get('VNU_ID'); } // $query_params set, pull the first related venue using those @@ -1389,7 +1389,7 @@ public function venue_ID(array $query_params = []): int public function venue(array $query_params = []) { // If no $query_params have been passed, use the VNU_ID assigned to the Datetime itself - if (empty($query_params)){ + if (empty($query_params)) { $VNU_ID = $this->venue_ID(); return $VNU_ID ? EEM_Venue::instance()->get_one_by_ID($VNU_ID) : null; } diff --git a/core/db_classes/EE_Event.class.php b/core/db_classes/EE_Event.class.php index 51c9c391bf..9703128a08 100644 --- a/core/db_classes/EE_Event.class.php +++ b/core/db_classes/EE_Event.class.php @@ -208,7 +208,7 @@ public function datetimes_in_chronological_order(): array /** * Gets all the datetimes for this event, ordered by the DTT_order on the datetime. - * @darren, we should probably UNSET timezone on the EEM_Datetime model + * @todo We should probably UNSET timezone on the EEM_Datetime model * after running our query, so that this timezone isn't set for EVERY query * on EEM_Datetime for the rest of the request, no? * diff --git a/core/db_classes/EE_Export.class.php b/core/db_classes/EE_Export.class.php index e301b08600..14366bb349 100644 --- a/core/db_classes/EE_Export.class.php +++ b/core/db_classes/EE_Export.class.php @@ -20,13 +20,13 @@ class EE_Export { const option_prefix = 'ee_report_job_'; - - // instance of the EE_Export object + /** + * instance of the EE_Export object + */ private static $_instance = null; - // instance of the EE_CSV object /** - * + * instance of the EE_CSV object * @var EE_CSV */ public $EE_CSV = null; @@ -36,10 +36,8 @@ class EE_Export /** - * private constructor to prevent direct creation + * private constructor to prevent direct creation * - * @Constructor - * @access private * @param array $request_data */ private function __construct($request_data = array()) @@ -52,11 +50,10 @@ private function __construct($request_data = array()) /** - * @ singleton method used to instantiate class object - * @ access public + * singleton method used to instantiate class object * * @param array $request_data - * @return \EE_Export + * @return EE_Export */ public static function instance($request_data = array()) { @@ -69,8 +66,7 @@ public static function instance($request_data = array()) /** - * @Export Event Espresso data - routes export requests - * @access public + * Export Event Espresso data - routes export requests * @return void | bool */ public function export() @@ -141,8 +137,7 @@ public function export_sample() /** - * @Export data for ALL events - * @access public + * Export data for ALL events * @return void * @throws EE_Error * @throws ReflectionException @@ -273,8 +268,7 @@ public function report_attendees() /** - * @Export data for ALL attendees - * @access public + * Export data for ALL attendees * @return void * @throws EE_Error */ @@ -686,8 +680,7 @@ protected function _get_column_name_for_field(EE_Model_Field_Base $field) /** - * @Export data for ALL events - * @access public + * Export data for ALL events * @return void */ public function export_categories() @@ -734,8 +727,7 @@ public function export_categories() /** - * @process export name to create a suitable filename - * @access private + * process export name to create a suitable filename * @param string - export_name * @return string on success, FALSE on fail */ @@ -753,8 +745,7 @@ private function generate_filename($export_name = '') /** - * @recursive function for exporting table data and merging the results with the next results - * @access private + * recursive function for exporting table data and merging the results with the next results * @param array $models_to_export keys are model names (eg 'Event', 'Attendee', etc.) and values are arrays of * query params @return bool on success, FALSE on fail * @throws EE_Error diff --git a/core/db_classes/EE_Import.class.php b/core/db_classes/EE_Import.class.php index e49190da7f..59f19ec071 100644 --- a/core/db_classes/EE_Import.class.php +++ b/core/db_classes/EE_Import.class.php @@ -18,13 +18,14 @@ class EE_Import implements ResettableInterface const do_nothing = 'nothing'; - // instance of the EE_Import object + /** + * instance of the EE_Import object + */ private static $_instance; private static $_csv_array = array(); /** - * * @var array of model names */ private static $_model_list = array(); @@ -44,10 +45,8 @@ class EE_Import implements ResettableInterface /** - * private constructor to prevent direct creation + * private constructor to prevent direct creation * - * @Constructor - * @access private * @return void */ private function __construct() @@ -60,8 +59,7 @@ private function __construct() /** - * @ singleton method used to instantiate class object - * @ access public + * singleton method used to instantiate class object * * @return EE_Import */ @@ -87,15 +85,14 @@ public static function reset() /** - * @ generates HTML for a file upload input and form - * @ access public + * generates HTML for a file upload input and form * * @param string $title - heading for the form * @param string $intro - additional text explaing what to do * @param string $page - EE Admin page to direct form to - in the form "espresso_{pageslug}" * @param string $action - EE Admin page route array "action" that form will direct to * @param string $type - type of file to import - * @ return string + * @return string */ public function upload_form($title, $intro, $form_url, $action, $type) { @@ -133,8 +130,7 @@ public function upload_form($title, $intro, $form_url, $action, $type) /** - * @Import Event Espresso data - some code "borrowed" from event espresso csv_import.php - * @access public + * Import Event Espresso data - some code "borrowed" from event espresso csv_import.php * @return boolean success */ public function import() @@ -304,19 +300,18 @@ public function import() * the same item, and instead update the item in the DB with that same ID. * Also note, we remember the mappings permanently. So the 2nd, 3rd, and 10000th * time you import a CSV from a different site, we remember their mappings, and - * will try to update the item in the DB instead of inserting another item (eg - * if we previously imported an event with temporary ID 1, and then it got a - * real ID of 123, we remember that. So the next time we import an event with - * temporary ID, from the same site, we know that it's real ID is 123, and will - * update that event, instead of adding a new event). + * will try to update the item in the DB instead of inserting another item (eg + * if we previously imported an event with temporary ID 1, and then it got a + * real ID of 123, we remember that. So the next time we import an event with + * temporary ID, from the same site, we know that it's real ID is 123, and will + * update that event, instead of adding a new event). * - * @access public * @param array $csv_data_array - the array containing the csv data produced from * EE_CSV::import_csv_to_model_data_array() * @param array $fields_to_save - an array containing the csv column names as keys with the corresponding db table * fields they will be saved to * @return TRUE on success, FALSE on fail - * @throws \EE_Error + * @throws EE_Error */ public function save_csv_data_array_to_db($csv_data_array, $model_name = false) { @@ -467,9 +462,9 @@ public function save_csv_data_array_to_db($csv_data_array, $model_name = false) * we need to insert a new row for that ID, and then map from the non-existent ID * to the newly-inserted real ID. * - * @param type $csv_data_array - * @param type $export_from_site_a_to_b - * @param type $old_db_to_new_db_mapping + * @param mixed $csv_data_array + * @param mixed $export_from_site_a_to_b + * @param mixed $old_db_to_new_db_mapping * @return array updated $old_db_to_new_db_mapping */ public function save_data_rows_to_db($csv_data_array, $export_from_site_a_to_b, $old_db_to_new_db_mapping) @@ -632,10 +627,10 @@ protected function _decide_whether_to_insert_or_update_given_data_from_other_db( * otherwise insert it (ie, someone tweaked the CSV file, or the item was * deleted in the database so it should be re-inserted) * - * @param type $id_in_csv - * @param type $model_object_data + * @param mixed $id_in_csv + * @param mixed $model_object_data * @param EEM_Base $model - * @param type $old_db_to_new_db_mapping + * @param mixed $old_db_to_new_db_mapping * @return */ protected function _decide_whether_to_insert_or_update_given_data_from_same_db( @@ -660,9 +655,9 @@ protected function _decide_whether_to_insert_or_update_given_data_from_same_db( * Also, if there is no temp ID for the INT foreign keys from another database, * replaces them with 0 or the field's default. * - * @param type $model_object_data + * @param mixed $model_object_data * @param EEM_Base $model - * @param type $old_db_to_new_db_mapping + * @param mixed $old_db_to_new_db_mapping * @param boolean $export_from_site_a_to_b * @return array updated model object data with temp IDs removed */ @@ -740,9 +735,9 @@ protected function _replace_temp_ids_with_mappings( /** * If the data was exported PRE-4.2, but then imported POST-4.2, then the term_id * this term-taxonomy refers to may be out-of-date so we need to update it. - * see https://make.wordpress.org/core/2015/02/16/taxonomy-term-splitting-in-4-2-a-developer-guide/ + * @see https://make.wordpress.org/core/2015/02/16/taxonomy-term-splitting-in-4-2-a-developer-guide/ * - * @param type $model_object_data + * @param mixed $model_object_data * @return array new model object data */ protected function _handle_split_term_ids($model_object_data) @@ -768,10 +763,10 @@ function_exists('wp_get_split_term'), * Given the object's ID and its model's name, find it int he mapping data, * bearing in mind where it came from * - * @param type $object_id + * @param mixed $object_id * @param string $model_name * @param array $old_db_to_new_db_mapping - * @param type $export_from_site_a_to_b + * @param mixed $export_from_site_a_to_b * @return int */ protected function _find_mapping_in($object_id, $model_name, $old_db_to_new_db_mapping, $export_from_site_a_to_b) @@ -794,10 +789,10 @@ protected function _find_mapping_in($object_id, $model_name, $old_db_to_new_db_m /** * - * @param type $id_in_csv - * @param type $model_object_data + * @param mixed $id_in_csv + * @param mixed $model_object_data * @param EEM_Base $model - * @param type $old_db_to_new_db_mapping + * @param mixed $old_db_to_new_db_mapping * @return array updated $old_db_to_new_db_mapping */ protected function _insert_from_data_array($id_in_csv, $model_object_data, $model, $old_db_to_new_db_mapping) diff --git a/core/db_classes/EE_Line_Item.class.php b/core/db_classes/EE_Line_Item.class.php index b9b020ef19..01d4db6279 100644 --- a/core/db_classes/EE_Line_Item.class.php +++ b/core/db_classes/EE_Line_Item.class.php @@ -858,10 +858,10 @@ public function ticket(array $query_params = []): ?EE_Ticket { // we're going to assume that when this method is called // we always want to receive the attached ticket EVEN if that ticket is archived. - if(! $this->OBJ_ID() || $this->OBJ_type() !== EEM_Line_Item::OBJ_TYPE_TICKET) { + if (! $this->OBJ_ID() || $this->OBJ_type() !== EEM_Line_Item::OBJ_TYPE_TICKET) { return null; } - if(empty($query_args)) { + if (empty($query_args)) { return EEM_Ticket::instance()->get_one_by_ID($this->OBJ_ID()); } // legacy usage diff --git a/core/db_classes/EE_Transaction.class.php b/core/db_classes/EE_Transaction.class.php index 65ef03f624..f2d7d21290 100644 --- a/core/db_classes/EE_Transaction.class.php +++ b/core/db_classes/EE_Transaction.class.php @@ -1205,7 +1205,7 @@ public function set_payment_method_ID($PMD_ID) public function payment_method() { $PMD_ID = $this->payment_method_ID(); - if($PMD_ID) { + if ($PMD_ID) { $pm = EEM_Payment_Method::instance()->get_one_by_ID($this->payment_method_ID()); if ($pm instanceof EE_Payment_Method) { return $pm; diff --git a/core/db_models/EEM_Base.model.php b/core/db_models/EEM_Base.model.php index 93b43c3b4c..2e5e5642cf 100644 --- a/core/db_models/EEM_Base.model.php +++ b/core/db_models/EEM_Base.model.php @@ -4396,27 +4396,27 @@ private function _construct_condition_clause_recursive($where_params, $glue = ' case 'NOT': $where_clauses[] = "! (" . $this->_construct_condition_clause_recursive( - $op_and_value_or_sub_condition, - $glue - ) + $op_and_value_or_sub_condition, + $glue + ) . ")"; break; case 'and': case 'AND': $where_clauses[] = " (" . $this->_construct_condition_clause_recursive( - $op_and_value_or_sub_condition, - ' AND ' - ) + $op_and_value_or_sub_condition, + ' AND ' + ) . ")"; break; case 'or': case 'OR': $where_clauses[] = " (" . $this->_construct_condition_clause_recursive( - $op_and_value_or_sub_condition, - ' OR ' - ) + $op_and_value_or_sub_condition, + ' OR ' + ) . ")"; break; } diff --git a/core/db_models/EEM_Message.model.php b/core/db_models/EEM_Message.model.php index 0afd03e972..e9e93fa106 100644 --- a/core/db_models/EEM_Message.model.php +++ b/core/db_models/EEM_Message.model.php @@ -126,7 +126,8 @@ protected function __construct(?string $timezone = '') $this->_fields = [ 'Message' => [ 'MSG_ID' => new EE_Primary_Key_Int_Field( - 'MSG_ID', esc_html__('Message ID', 'event_espresso') + 'MSG_ID', + esc_html__('Message ID', 'event_espresso') ), 'MSG_token' => new EE_Plain_Text_Field( 'MSG_token', diff --git a/core/db_models/EEM_Price_Type.model.php b/core/db_models/EEM_Price_Type.model.php index e7e68a7e18..95137ffccb 100644 --- a/core/db_models/EEM_Price_Type.model.php +++ b/core/db_models/EEM_Price_Type.model.php @@ -92,7 +92,8 @@ protected function __construct(?string $timezone = '') $this->_fields = [ 'Price_Type' => [ 'PRT_ID' => new EE_Primary_Key_Int_Field( - 'PRT_ID', esc_html__('Price Type ID', 'event_espresso') + 'PRT_ID', + esc_html__('Price Type ID', 'event_espresso') ), 'PRT_name' => new EE_Plain_Text_Field( 'PRT_name', diff --git a/core/db_models/EEM_Registration.model.php b/core/db_models/EEM_Registration.model.php index 02cd17b03c..6ca77ab87e 100644 --- a/core/db_models/EEM_Registration.model.php +++ b/core/db_models/EEM_Registration.model.php @@ -58,7 +58,7 @@ class EEM_Registration extends EEM_Soft_Delete_Base protected static ?EEM_Registration $_instance = null; - protected ?TableAnalysis $_table_analysis = null; + protected ?TableAnalysis $_table_analysis = null; /** * Keys are the status IDs for registrations (eg, RAP, RCN, etc), and the values @@ -453,7 +453,8 @@ public function get_registration_for_reg_url_link(string $REG_url_link): ?EE_Reg * @throws EE_Error */ public function get_registration_for_transaction_attendee(int $TXN_ID = 0, int $ATT_ID = 0, int $att_nmbr = 0): - ?EE_Registration { + ?EE_Registration + { return $this->get_one( [ [ diff --git a/core/db_models/EEM_Status.model.php b/core/db_models/EEM_Status.model.php index 2e64163628..a9b88360d4 100644 --- a/core/db_models/EEM_Status.model.php +++ b/core/db_models/EEM_Status.model.php @@ -30,7 +30,10 @@ protected function __construct(?string $timezone = '') 'StatusTable' => [ 'STS_ID' => new EE_Primary_Key_String_Field('STS_ID', esc_html__('Status ID', 'event_espresso')), 'STS_code' => new EE_Plain_Text_Field( - 'STS_code', esc_html__('Status Code', 'event_espresso'), false, '' + 'STS_code', + esc_html__('Status Code', 'event_espresso'), + false, + '' ), 'STS_type' => new EE_Enum_Text_Field( 'STS_type', diff --git a/core/db_models/EEM_System_Status.model.php b/core/db_models/EEM_System_Status.model.php index c5cc417a3a..8b11a94039 100644 --- a/core/db_models/EEM_System_Status.model.php +++ b/core/db_models/EEM_System_Status.model.php @@ -338,9 +338,9 @@ public function get_remote_posting() $status = esc_html__('Your server has cURL enabled, fsockopen is disabled.', 'event_espresso'); } else { $status = esc_html__( - 'Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', - 'event_espresso' - ) . ''; + 'Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', + 'event_espresso' + ) . ''; } return $status; } diff --git a/core/db_models/EEM_Term.model.php b/core/db_models/EEM_Term.model.php index ca172ecb23..dcf7327a95 100644 --- a/core/db_models/EEM_Term.model.php +++ b/core/db_models/EEM_Term.model.php @@ -31,7 +31,10 @@ protected function __construct(?string $timezone = '') 'name' => new EE_Plain_Text_Field('name', esc_html__('Term Name', 'event_espresso'), false, ''), 'slug' => new EE_Slug_Field('slug', esc_html__('Term Slug', 'event_espresso'), false), 'term_group' => new EE_Integer_Field( - 'term_group', esc_html__("Term Group", "event_espresso"), false, 0 + 'term_group', + esc_html__("Term Group", "event_espresso"), + false, + 0 ), ], ]; diff --git a/core/db_models/EEM_Ticket.model.php b/core/db_models/EEM_Ticket.model.php index bd4d615dfe..f56ad170da 100644 --- a/core/db_models/EEM_Ticket.model.php +++ b/core/db_models/EEM_Ticket.model.php @@ -253,9 +253,9 @@ protected function __construct(?string $timezone = '') // account for default tickets in the caps $this->_cap_restriction_generators[ EEM_Base::caps_read_admin ] = new EE_Restriction_Generator_Default_Protected( - 'TKT_is_default', - $path_to_event - ); + 'TKT_is_default', + $path_to_event + ); $this->_cap_restriction_generators[ EEM_Base::caps_edit ] = new EE_Restriction_Generator_Default_Protected( 'TKT_is_default', $path_to_event diff --git a/core/db_models/EEM_Ticket_Template.model.php b/core/db_models/EEM_Ticket_Template.model.php index 40b4e322bb..fd730c3363 100644 --- a/core/db_models/EEM_Ticket_Template.model.php +++ b/core/db_models/EEM_Ticket_Template.model.php @@ -32,7 +32,8 @@ protected function __construct(?string $timezone = '') $this->_fields = [ 'Ticket_Template' => [ 'TTM_ID' => new EE_Primary_Key_Int_Field( - 'TTM_ID', esc_html__('Ticket Template ID', 'event_espresso') + 'TTM_ID', + esc_html__('Ticket Template ID', 'event_espresso') ), 'TTM_name' => new EE_Plain_Text_Field( 'TTM_name', diff --git a/core/db_models/EEM_Transaction.model.php b/core/db_models/EEM_Transaction.model.php index 596e947e40..cb57f35ce4 100644 --- a/core/db_models/EEM_Transaction.model.php +++ b/core/db_models/EEM_Transaction.model.php @@ -84,7 +84,8 @@ protected function __construct(?string $timezone = '') $this->_fields = [ 'TransactionTable' => [ 'TXN_ID' => new EE_Primary_Key_Int_Field( - 'TXN_ID', esc_html__('Transaction ID', 'event_espresso') + 'TXN_ID', + esc_html__('Transaction ID', 'event_espresso') ), 'TXN_timestamp' => new EE_Datetime_Field( 'TXN_timestamp', diff --git a/core/db_models/fields/EE_Datetime_Field.php b/core/db_models/fields/EE_Datetime_Field.php index 1af989ec80..d84bccc614 100644 --- a/core/db_models/fields/EE_Datetime_Field.php +++ b/core/db_models/fields/EE_Datetime_Field.php @@ -56,13 +56,13 @@ class EE_Datetime_Field extends EE_Model_Field_Base * (and corresponding set_date_format, set_time_format methods); */ - protected string $_date_format = ''; + protected string $_date_format = ''; - protected string $_time_format = ''; + protected string $_time_format = ''; - protected string $_pretty_date_format = ''; + protected string $_pretty_date_format = ''; - protected string $_pretty_time_format = ''; + protected string $_pretty_time_format = ''; protected ?DateTimeZone $_DateTimeZone = null; diff --git a/core/db_models/fields/EE_Email_Field.php b/core/db_models/fields/EE_Email_Field.php index 648bec8955..24860d9b24 100644 --- a/core/db_models/fields/EE_Email_Field.php +++ b/core/db_models/fields/EE_Email_Field.php @@ -25,7 +25,7 @@ class EE_Email_Field extends EE_Text_Field_Base public function __construct($table_column, $nice_name, $nullable, $default_value = null) { parent::__construct($table_column, $nice_name, $nullable, $default_value); - $this->setSchemaFormat( SchemaFormat::EMAIL); + $this->setSchemaFormat(SchemaFormat::EMAIL); } diff --git a/core/db_models/helpers/EE_Secondary_Table.php b/core/db_models/helpers/EE_Secondary_Table.php index 2203db2725..76e36341da 100644 --- a/core/db_models/helpers/EE_Secondary_Table.php +++ b/core/db_models/helpers/EE_Secondary_Table.php @@ -8,7 +8,6 @@ */ class EE_Secondary_Table extends EE_Table_Base { - protected ?string $_extra_join_conditions; protected ?string $_fk_on_table; diff --git a/core/db_models/relations/EE_Belongs_To_Any_Relation.php b/core/db_models/relations/EE_Belongs_To_Any_Relation.php index d5cabfcbf7..12e68b434c 100644 --- a/core/db_models/relations/EE_Belongs_To_Any_Relation.php +++ b/core/db_models/relations/EE_Belongs_To_Any_Relation.php @@ -33,23 +33,23 @@ public function get_join_statement(string $model_relation_chain): string $other_table_pk_field = $this->get_other_model()->get_primary_key_field(); $this_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix( - $model_relation_chain, - $this->get_this_model()->get_this_model_name() - ) . $this_table_fk_field->get_table_alias(); + $model_relation_chain, + $this->get_this_model()->get_this_model_name() + ) . $this_table_fk_field->get_table_alias(); $other_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix( - $model_relation_chain, - $this->get_other_model()->get_this_model_name() - ) . $other_table_pk_field->get_table_alias(); + $model_relation_chain, + $this->get_other_model()->get_this_model_name() + ) . $other_table_pk_field->get_table_alias(); $other_table = $this->get_other_model()->get_table_for_alias($other_table_alias); return $this->_left_join( - $other_table, - $other_table_alias, - $other_table_pk_field->get_table_column(), - $this_table_alias, - $this_table_fk_field->get_table_column(), - $field_with_model_name->get_qualified_column() . "='" . $this->get_other_model()->get_this_model_name( - ) . "'" - ) + $other_table, + $other_table_alias, + $other_table_pk_field->get_table_column(), + $this_table_alias, + $this_table_fk_field->get_table_column(), + $field_with_model_name->get_qualified_column() . "='" . $this->get_other_model()->get_this_model_name( + ) . "'" + ) . $this->get_other_model()->_construct_internal_join_to_table_with_alias($other_table_alias); } diff --git a/core/db_models/relations/EE_Belongs_To_Relation.php b/core/db_models/relations/EE_Belongs_To_Relation.php index 11c0709566..f1d003da2c 100644 --- a/core/db_models/relations/EE_Belongs_To_Relation.php +++ b/core/db_models/relations/EE_Belongs_To_Relation.php @@ -44,21 +44,21 @@ public function get_join_statement(string $model_relation_chain): string $this->get_this_model()->get_foreign_key_to($this->get_other_model()->get_this_model_name()); $other_table_pk_field = $this->get_other_model()->get_primary_key_field(); $this_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix( - $model_relation_chain, - $this->get_this_model()->get_this_model_name() - ) . $this_table_fk_field->get_table_alias(); + $model_relation_chain, + $this->get_this_model()->get_this_model_name() + ) . $this_table_fk_field->get_table_alias(); $other_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix( - $model_relation_chain, - $this->get_other_model()->get_this_model_name() - ) . $other_table_pk_field->get_table_alias(); + $model_relation_chain, + $this->get_other_model()->get_this_model_name() + ) . $other_table_pk_field->get_table_alias(); $other_table = $this->get_other_model()->get_table_for_alias($other_table_alias); return $this->_left_join( - $other_table, - $other_table_alias, - $other_table_pk_field->get_table_column(), - $this_table_alias, - $this_table_fk_field->get_table_column() - ) . $this->get_other_model()->_construct_internal_join_to_table_with_alias($other_table_alias); + $other_table, + $other_table_alias, + $other_table_pk_field->get_table_column(), + $this_table_alias, + $this_table_fk_field->get_table_column() + ) . $this->get_other_model()->_construct_internal_join_to_table_with_alias($other_table_alias); } @@ -153,7 +153,7 @@ public function get_all_related( } $ID_value_on_other_model = $model_obj->get($fk_field_obj->get_name()); // if PK ID is empty, there is nothing to match to - if(empty($ID_value_on_other_model)) { + if (empty($ID_value_on_other_model)) { return []; } // get all where their PK matches that value diff --git a/core/db_models/relations/EE_HABTM_Any_Relation.php b/core/db_models/relations/EE_HABTM_Any_Relation.php index 227fc7a0fb..fad10709da 100644 --- a/core/db_models/relations/EE_HABTM_Any_Relation.php +++ b/core/db_models/relations/EE_HABTM_Any_Relation.php @@ -82,24 +82,24 @@ public function get_join_to_intermediate_model_statement(string $model_relation_ 'name' ); $this_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix( - $model_relation_chain, - $this->get_this_model()->get_this_model_name() - ) . $this_table_pk_field->get_table_alias(); + $model_relation_chain, + $this->get_this_model()->get_this_model_name() + ) . $this_table_pk_field->get_table_alias(); $join_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix( - $model_relation_chain, - $this->get_join_model()->get_this_model_name() - ) . $join_table_fk_field_to_this_table->get_table_alias(); + $model_relation_chain, + $this->get_join_model()->get_this_model_name() + ) . $join_table_fk_field_to_this_table->get_table_alias(); $join_table = $this->get_join_model()->get_table_for_alias($join_table_alias); // phew! ok, we have all the info we need, now we can create the SQL join string return $this->_left_join( - $join_table, - $join_table_alias, - $join_table_fk_field_to_this_table->get_table_column(), - $this_table_alias, - $this_table_pk_field->get_table_column(), - $field_with_model_name->get_qualified_column() . "='" . $this->get_this_model()->get_this_model_name( - ) . "'" - ) . + $join_table, + $join_table_alias, + $join_table_fk_field_to_this_table->get_table_column(), + $this_table_alias, + $this_table_pk_field->get_table_column(), + $field_with_model_name->get_qualified_column() . "='" . $this->get_this_model()->get_this_model_name( + ) . "'" + ) . $this->get_join_model()->_construct_internal_join_to_table_with_alias($join_table_alias); } @@ -140,26 +140,26 @@ public function get_join_statement(string $model_relation_chain): string ); $join_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix( - $this->_model_relation_chain_to_join_model, - $this->get_join_model()->get_this_model_name() - ) . $join_table_fk_field_to_this_table->get_table_alias(); + $this->_model_relation_chain_to_join_model, + $this->get_join_model()->get_this_model_name() + ) . $join_table_fk_field_to_this_table->get_table_alias(); $other_table_pk_field = $this->get_other_model()->get_primary_key_field(); $other_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix( - $model_relation_chain, - $this->get_other_model()->get_this_model_name() - ) . $other_table_pk_field->get_table_alias(); + $model_relation_chain, + $this->get_other_model()->get_this_model_name() + ) . $other_table_pk_field->get_table_alias(); $other_table = $this->get_other_model()->get_table_for_alias($other_table_alias); return $this->_left_join( - $other_table, - $other_table_alias, - $other_table_pk_field->get_table_column(), - $join_table_alias, - $join_table_fk_field_to_other_table->get_table_column(), - $field_with_other_model_name->get_qualified_column() . "='" . $this->get_other_model() + $other_table, + $other_table_alias, + $other_table_pk_field->get_table_column(), + $join_table_alias, + $join_table_fk_field_to_other_table->get_table_column(), + $field_with_other_model_name->get_qualified_column() . "='" . $this->get_other_model() ->get_this_model_name() . "'" - ) . + ) . $this->get_other_model()->_construct_internal_join_to_table_with_alias($other_table_alias); } diff --git a/core/db_models/relations/EE_HABTM_Relation.php b/core/db_models/relations/EE_HABTM_Relation.php index 61dfa87a2c..3a7ede2ae0 100644 --- a/core/db_models/relations/EE_HABTM_Relation.php +++ b/core/db_models/relations/EE_HABTM_Relation.php @@ -74,23 +74,23 @@ public function get_join_to_intermediate_model_statement(string $model_relation_ $join_table_fk_field_to_this_table = $this->get_join_model()->get_foreign_key_to($this->get_this_model()->get_this_model_name()); $this_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix( - $model_relation_chain, - $this->get_this_model()->get_this_model_name() - ) . $this_table_pk_field->get_table_alias(); + $model_relation_chain, + $this->get_this_model()->get_this_model_name() + ) . $this_table_pk_field->get_table_alias(); $join_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix( - $model_relation_chain, - $this->get_join_model()->get_this_model_name() - ) . $join_table_fk_field_to_this_table->get_table_alias(); + $model_relation_chain, + $this->get_join_model()->get_this_model_name() + ) . $join_table_fk_field_to_this_table->get_table_alias(); $join_table = $this->get_join_model()->get_table_for_alias($join_table_alias); // phew! ok, we have all the info we need, now we can create the SQL join string return $this->_left_join( - $join_table, - $join_table_alias, - $join_table_fk_field_to_this_table->get_table_column(), - $this_table_alias, - $this_table_pk_field->get_table_column() - ) . $this->get_join_model()->_construct_internal_join_to_table_with_alias($join_table_alias); + $join_table, + $join_table_alias, + $join_table_fk_field_to_this_table->get_table_column(), + $this_table_alias, + $this_table_pk_field->get_table_column() + ) . $this->get_join_model()->_construct_internal_join_to_table_with_alias($join_table_alias); } @@ -120,26 +120,26 @@ public function get_join_statement(string $model_relation_chain): string $this->get_this_model()->get_this_model_name() ); $join_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix( - $this->_model_relation_chain_to_join_model, - $this->get_join_model()->get_this_model_name() - ) . $join_table_fk_field_to_this_table->get_table_alias(); + $this->_model_relation_chain_to_join_model, + $this->get_join_model()->get_this_model_name() + ) . $join_table_fk_field_to_this_table->get_table_alias(); $other_table_pk_field = $this->get_other_model()->get_primary_key_field(); $join_table_fk_field_to_other_table = $this->get_join_model()->get_foreign_key_to( $this->get_other_model()->get_this_model_name() ); $other_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix( - $model_relation_chain, - $this->get_other_model()->get_this_model_name() - ) . $other_table_pk_field->get_table_alias(); + $model_relation_chain, + $this->get_other_model()->get_this_model_name() + ) . $other_table_pk_field->get_table_alias(); $other_table = $this->get_other_model()->get_table_for_alias($other_table_alias); return $this->_left_join( - $other_table, - $other_table_alias, - $other_table_pk_field->get_table_column(), - $join_table_alias, - $join_table_fk_field_to_other_table->get_table_column() - ) . $this->get_other_model()->_construct_internal_join_to_table_with_alias($other_table_alias); + $other_table, + $other_table_alias, + $other_table_pk_field->get_table_column(), + $join_table_alias, + $join_table_fk_field_to_other_table->get_table_column() + ) . $this->get_other_model()->_construct_internal_join_to_table_with_alias($other_table_alias); } diff --git a/core/db_models/relations/EE_Has_Many_Any_Relation.php b/core/db_models/relations/EE_Has_Many_Any_Relation.php index 404e471fe9..22fa9e89a0 100644 --- a/core/db_models/relations/EE_Has_Many_Any_Relation.php +++ b/core/db_models/relations/EE_Has_Many_Any_Relation.php @@ -31,25 +31,25 @@ public function get_join_statement(string $model_relation_chain): string $other_table_fk_field = $this->get_other_model()->get_foreign_key_to($this->get_this_model()->get_this_model_name()); $pk_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix( - $model_relation_chain, - $this->get_this_model()->get_this_model_name() - ) . $this_table_pk_field->get_table_alias(); + $model_relation_chain, + $this->get_this_model()->get_this_model_name() + ) . $this_table_pk_field->get_table_alias(); $fk_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix( - $model_relation_chain, - $this->get_other_model()->get_this_model_name() - ) . $other_table_fk_field->get_table_alias(); + $model_relation_chain, + $this->get_other_model()->get_this_model_name() + ) . $other_table_fk_field->get_table_alias(); $fk_table = $this->get_other_model()->get_table_for_alias($fk_table_alias); $field_with_model_name = $this->get_other_model()->get_field_containing_related_model_name(); return $this->_left_join( - $fk_table, - $fk_table_alias, - $other_table_fk_field->get_table_column(), - $pk_table_alias, - $this_table_pk_field->get_table_column(), - $fk_table_alias . '.' . $field_with_model_name->get_table_column() + $fk_table, + $fk_table_alias, + $other_table_fk_field->get_table_column(), + $pk_table_alias, + $this_table_pk_field->get_table_column(), + $fk_table_alias . '.' . $field_with_model_name->get_table_column() . "='" . $this->get_this_model()->get_this_model_name() . "'" - ) + ) . $this->get_other_model()->_construct_internal_join_to_table_with_alias($fk_table_alias); } diff --git a/core/db_models/relations/EE_Has_Many_Relation.php b/core/db_models/relations/EE_Has_Many_Relation.php index 5dea1f3817..5f5140dabe 100644 --- a/core/db_models/relations/EE_Has_Many_Relation.php +++ b/core/db_models/relations/EE_Has_Many_Relation.php @@ -45,22 +45,22 @@ public function get_join_statement(string $model_relation_chain): string $other_table_fk_field = $this->get_other_model()->get_foreign_key_to($this->get_this_model()->get_this_model_name()); $pk_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix( - $model_relation_chain, - $this->get_this_model()->get_this_model_name() - ) . $this_table_pk_field->get_table_alias(); + $model_relation_chain, + $this->get_this_model()->get_this_model_name() + ) . $this_table_pk_field->get_table_alias(); $fk_table_alias = EE_Model_Parser::extract_table_alias_model_relation_chain_prefix( - $model_relation_chain, - $this->get_other_model()->get_this_model_name() - ) . $other_table_fk_field->get_table_alias(); + $model_relation_chain, + $this->get_other_model()->get_this_model_name() + ) . $other_table_fk_field->get_table_alias(); $fk_table = $this->get_other_model()->get_table_for_alias($fk_table_alias); return $this->_left_join( - $fk_table, - $fk_table_alias, - $other_table_fk_field->get_table_column(), - $pk_table_alias, - $this_table_pk_field->get_table_column() - ) . $this->get_other_model()->_construct_internal_join_to_table_with_alias($fk_table_alias); + $fk_table, + $fk_table_alias, + $other_table_fk_field->get_table_column(), + $pk_table_alias, + $this_table_pk_field->get_table_column() + ) . $this->get_other_model()->_construct_internal_join_to_table_with_alias($fk_table_alias); } diff --git a/core/db_models/relations/EE_Model_Relation_Base.php b/core/db_models/relations/EE_Model_Relation_Base.php index 73098ab0c6..9da8b529c6 100644 --- a/core/db_models/relations/EE_Model_Relation_Base.php +++ b/core/db_models/relations/EE_Model_Relation_Base.php @@ -48,7 +48,7 @@ abstract class EE_Model_Relation_Base implements HasSchemaInterface */ protected ?string $_blocking_delete_error_message; - protected bool $_blocking_delete = false; + protected bool $_blocking_delete = false; /** diff --git a/core/domain/entities/config/legacy/EE_Config_Base.php b/core/domain/entities/config/legacy/EE_Config_Base.php index 21c5dcf6e1..701ae79658 100644 --- a/core/domain/entities/config/legacy/EE_Config_Base.php +++ b/core/domain/entities/config/legacy/EE_Config_Base.php @@ -78,7 +78,7 @@ public function populate() } if ($is_static_property) { // double $$ is not a typo, it's how to access a static variable dynamically. - $class_name::$$property = $static_defaults[$property]; + $class_name::$$property = $static_defaults[ $property ]; continue; } if ($is_public_property) { diff --git a/core/domain/entities/config/legacy/EE_Core_Config.php b/core/domain/entities/config/legacy/EE_Core_Config.php index 884ae77b45..01f7b9095a 100644 --- a/core/domain/entities/config/legacy/EE_Core_Config.php +++ b/core/domain/entities/config/legacy/EE_Core_Config.php @@ -124,9 +124,9 @@ public function reg_page_url(): string { if (! $this->reg_page_url) { $this->reg_page_url = add_query_arg( - ['uts' => time()], - get_permalink($this->reg_page_id) - ) . '#checkout'; + ['uts' => time()], + get_permalink($this->reg_page_id) + ) . '#checkout'; } return $this->reg_page_url; } diff --git a/core/domain/entities/custom_post_types/EspressoPostType.php b/core/domain/entities/custom_post_types/EspressoPostType.php index 0df3fa1d57..ca6b53eacb 100644 --- a/core/domain/entities/custom_post_types/EspressoPostType.php +++ b/core/domain/entities/custom_post_types/EspressoPostType.php @@ -9,5 +9,4 @@ class EspressoPostType public const VENUES = 'espresso_venues'; public const ATTENDEES = 'espresso_attendees'; - } diff --git a/core/domain/entities/routing/handlers/admin/EspressoBatchJob.php b/core/domain/entities/routing/handlers/admin/EspressoBatchJob.php index 1fe8c4d473..baf842582f 100644 --- a/core/domain/entities/routing/handlers/admin/EspressoBatchJob.php +++ b/core/domain/entities/routing/handlers/admin/EspressoBatchJob.php @@ -17,7 +17,6 @@ */ class EspressoBatchJob extends AdminRoute { - /** * returns true if the current request matches this route * diff --git a/core/domain/entities/users/CurrentUser.php b/core/domain/entities/users/CurrentUser.php index d6bb068806..93f5df9a0a 100644 --- a/core/domain/entities/users/CurrentUser.php +++ b/core/domain/entities/users/CurrentUser.php @@ -15,13 +15,13 @@ class CurrentUser { private EventManagers $event_managers; - private ?WP_User $current_user = null; + private ?WP_User $current_user = null; - private bool $is_event_manager = false; + private bool $is_event_manager = false; - private bool $is_logged_in = false; + private bool $is_logged_in = false; - private bool $is_super_admin = false; + private bool $is_super_admin = false; /** diff --git a/core/domain/services/admin/AdminToolBar.php b/core/domain/services/admin/AdminToolBar.php index 789f2dd065..f2f4f1696d 100644 --- a/core/domain/services/admin/AdminToolBar.php +++ b/core/domain/services/admin/AdminToolBar.php @@ -20,15 +20,15 @@ */ class AdminToolBar { - private ?WP_Admin_Bar $admin_bar = null; + private ?WP_Admin_Bar $admin_bar = null; private EE_Capabilities $capabilities; - private string $events_admin_url = ''; + private string $events_admin_url = ''; - private string $menu_class = 'espresso_menu_item_class'; + private string $menu_class = 'espresso_menu_item_class'; - private string $reg_admin_url = ''; + private string $reg_admin_url = ''; /** diff --git a/core/domain/services/admin/events/default_settings/AdvancedEditorAdminFormSection.php b/core/domain/services/admin/events/default_settings/AdvancedEditorAdminFormSection.php index 29ea9c4dc9..8e19ee0498 100644 --- a/core/domain/services/admin/events/default_settings/AdvancedEditorAdminFormSection.php +++ b/core/domain/services/admin/events/default_settings/AdvancedEditorAdminFormSection.php @@ -37,7 +37,7 @@ */ class AdvancedEditorAdminFormSection { - protected EE_Admin_Config $admin_config; + protected EE_Admin_Config $admin_config; /** diff --git a/core/domain/services/admin/events/editor/ui/PermalinkHtmlHook.php b/core/domain/services/admin/events/editor/ui/PermalinkHtmlHook.php index 78c4ee3b52..75b4c753b6 100644 --- a/core/domain/services/admin/events/editor/ui/PermalinkHtmlHook.php +++ b/core/domain/services/admin/events/editor/ui/PermalinkHtmlHook.php @@ -10,5 +10,5 @@ public static function addEventEditorPermalinkButton(int $priority = 10, int $ac } - abstract public static function addButton( string $html, int $post_id ): string; + abstract public static function addButton(string $html, int $post_id): string; } diff --git a/core/domain/services/capabilities/FeatureFlag.php b/core/domain/services/capabilities/FeatureFlag.php index 6ab4a7fd9c..5413a3391f 100644 --- a/core/domain/services/capabilities/FeatureFlag.php +++ b/core/domain/services/capabilities/FeatureFlag.php @@ -10,7 +10,6 @@ */ class FeatureFlag { - /** * Whether to use the New Event Editor (EDTR) or continue using the legacy Event Editor * deafult: Enabled for Caffeinated sites, disabled for Decaf or Multisite installs diff --git a/core/domain/services/capabilities/FeatureFlags.php b/core/domain/services/capabilities/FeatureFlags.php index 972953cd8d..eb8f868946 100644 --- a/core/domain/services/capabilities/FeatureFlags.php +++ b/core/domain/services/capabilities/FeatureFlags.php @@ -72,7 +72,7 @@ public function allowed(string $feature): bool */ public function getAllowedFeatures(): array { - $allowed = array_filter( (array) $this->feature_flags, [$this, 'allowed'], ARRAY_FILTER_USE_KEY); + $allowed = array_filter((array) $this->feature_flags, [$this, 'allowed'], ARRAY_FILTER_USE_KEY); return array_keys($allowed); } } diff --git a/core/domain/services/capabilities/FeatureFlagsConfig.php b/core/domain/services/capabilities/FeatureFlagsConfig.php index e5af67b056..f63eb01592 100644 --- a/core/domain/services/capabilities/FeatureFlagsConfig.php +++ b/core/domain/services/capabilities/FeatureFlagsConfig.php @@ -146,7 +146,7 @@ public function enableFeatureFlag(string $feature_flag, bool $add_if_missing = f $this->feature_flags->{$feature_flag} = true; // if feature flag is the advanced event editor bulk edit options // then only enabled if the site is Caffeinated and not MultiSite - if ( $feature_flag === FeatureFlag::USE_EVENT_EDITOR_BULK_EDIT ) { + if ($feature_flag === FeatureFlag::USE_EVENT_EDITOR_BULK_EDIT) { $this->feature_flags->{$feature_flag} = $this->domain->isCaffeinated() && ! $this->domain->isMultiSite(); } if ($save) { diff --git a/core/domain/services/contexts/RequestTypeContextDetector.php b/core/domain/services/contexts/RequestTypeContextDetector.php index 82c1ce06bd..452e6dc5ef 100644 --- a/core/domain/services/contexts/RequestTypeContextDetector.php +++ b/core/domain/services/contexts/RequestTypeContextDetector.php @@ -50,7 +50,7 @@ public function __construct( $this->request = $request; $this->factory = $factory; $this->globalRouteConditions = $globalRouteConditions; - $permalink_structure = ltrim((string) get_option( 'permalink_structure' ), '/'); + $permalink_structure = ltrim((string) get_option('permalink_structure'), '/'); $this->permalink_prefix = strpos($permalink_structure, 'index.php') === 0 ? '/index.php/' : ''; } diff --git a/core/domain/services/converters/RestApiSpoofer.php b/core/domain/services/converters/RestApiSpoofer.php index 7b581a4165..aea40d28e3 100644 --- a/core/domain/services/converters/RestApiSpoofer.php +++ b/core/domain/services/converters/RestApiSpoofer.php @@ -31,9 +31,9 @@ class RestApiSpoofer { protected EED_Core_Rest_Api $rest_module; - protected Read $rest_controller; + protected Read $rest_controller; - protected WP_REST_Server $wp_rest_server; + protected WP_REST_Server $wp_rest_server; /** diff --git a/core/domain/services/cron/CronJob.php b/core/domain/services/cron/CronJob.php index b4fe505946..5b33180987 100644 --- a/core/domain/services/cron/CronJob.php +++ b/core/domain/services/cron/CronJob.php @@ -6,7 +6,6 @@ abstract class CronJob { - protected LoaderInterface $loader; diff --git a/core/domain/services/cron/jobs/ExpiredTransactionCheck.php b/core/domain/services/cron/jobs/ExpiredTransactionCheck.php index 1bd035b327..365af74bbb 100644 --- a/core/domain/services/cron/jobs/ExpiredTransactionCheck.php +++ b/core/domain/services/cron/jobs/ExpiredTransactionCheck.php @@ -129,7 +129,6 @@ public function processExpiredTransactions(): void // verify transaction and whether it is failed or not if ($transaction instanceof EE_Transaction) { switch ($transaction->status_ID()) { - case EEM_Transaction::complete_status_code: $this->processCompletedTransaction($transaction); break; diff --git a/core/domain/services/graphql/resolvers/FieldResolverV2.php b/core/domain/services/graphql/resolvers/FieldResolverV2.php index d3ed02b390..729bbec443 100644 --- a/core/domain/services/graphql/resolvers/FieldResolverV2.php +++ b/core/domain/services/graphql/resolvers/FieldResolverV2.php @@ -32,7 +32,7 @@ protected function fieldsToArray(array $fields): array { $array = []; foreach ($fields as $f) { - $array[$f->name()] = $f; + $array[ $f->name() ] = $f; } return $array; } @@ -88,10 +88,10 @@ protected function findField(ResolveInfo $info) { $key = $info->fieldName; - if (! isset($this->fields[$key])) { + if (! isset($this->fields[ $key ])) { return false; } - return $this->fields[$key]; + return $this->fields[ $key ]; } } diff --git a/core/domain/services/graphql/resolvers/StatelessResolver.php b/core/domain/services/graphql/resolvers/StatelessResolver.php index f8deb4f0c1..37ed57faa3 100644 --- a/core/domain/services/graphql/resolvers/StatelessResolver.php +++ b/core/domain/services/graphql/resolvers/StatelessResolver.php @@ -56,7 +56,9 @@ protected function resolveEvent(EE_Base_Class $source, AppContext $context): ?De break; } - if (! ($event instanceof EE_Event)) return null; + if (! ($event instanceof EE_Event)) { +return null; + } return $context->get_loader('post')->load_deferred($event->ID()); } diff --git a/core/domain/services/licensing/LicenseData.php b/core/domain/services/licensing/LicenseData.php index e9e45d9113..d36761b2d7 100644 --- a/core/domain/services/licensing/LicenseData.php +++ b/core/domain/services/licensing/LicenseData.php @@ -9,7 +9,6 @@ class LicenseData { - public const LICENSE_ACTIVE = 'active'; public const LICENSE_DECAF = 'decaf'; diff --git a/core/domain/services/licensing/LicenseDataEDD.php b/core/domain/services/licensing/LicenseDataEDD.php index 6108a94187..0ffacc17db 100644 --- a/core/domain/services/licensing/LicenseDataEDD.php +++ b/core/domain/services/licensing/LicenseDataEDD.php @@ -15,7 +15,6 @@ */ class LicenseDataEDD implements LicenseDataStrategy { - private LicenseKeyData $license_key_data; private string $status; diff --git a/core/domain/services/licensing/LicenseDataStrategy.php b/core/domain/services/licensing/LicenseDataStrategy.php index feb5a8b68b..db60ca8e98 100644 --- a/core/domain/services/licensing/LicenseDataStrategy.php +++ b/core/domain/services/licensing/LicenseDataStrategy.php @@ -4,11 +4,11 @@ interface LicenseDataStrategy { - public function loadLicenseData(); + public function loadLicenseData(); - public function getLicenseStatus(): string; + public function getLicenseStatus(): string; - public function getLicenseExpiry(): string; + public function getLicenseExpiry(): string; } diff --git a/core/domain/services/licensing/LicenseKeysAdminForm.php b/core/domain/services/licensing/LicenseKeysAdminForm.php index a032affc2b..f2ca0b22b4 100644 --- a/core/domain/services/licensing/LicenseKeysAdminForm.php +++ b/core/domain/services/licensing/LicenseKeysAdminForm.php @@ -13,7 +13,6 @@ class LicenseKeysAdminForm extends FormHandler { - public function __construct(EE_Registry $registry) { parent::__construct( @@ -112,8 +111,8 @@ private function addCoreSupportLicenseKey(array $subsections): array ]; if ($core_license_key instanceof LicenseKeyFormInput && $core_license_key->get_default()) { - unset ($new_subsections['support_license_notice']); - unset ($new_subsections['add-on-license-keys-notice']); + unset($new_subsections['support_license_notice']); + unset($new_subsections['add-on-license-keys-notice']); } return EEH_Array::insert_into_array($subsections, $new_subsections); } diff --git a/core/domain/services/licensing/LicenseStatus.php b/core/domain/services/licensing/LicenseStatus.php index 509728dee5..a31bafcd8f 100644 --- a/core/domain/services/licensing/LicenseStatus.php +++ b/core/domain/services/licensing/LicenseStatus.php @@ -44,7 +44,7 @@ public static function statusMessage(?string $license_status): string public static function statusClass(?string $license_status): string { - switch ( $license_status ) { + switch ($license_status) { case "valid": return "active"; @@ -70,7 +70,7 @@ public static function statusClass(?string $license_status): string public static function statusIcon(?string $license_status): string { - switch ( $license_status ) { + switch ($license_status) { case "valid": return "yes-alt"; diff --git a/core/domain/services/messages/MessageTemplateManager.php b/core/domain/services/messages/MessageTemplateManager.php index 8e31725ca0..1d00aaad23 100644 --- a/core/domain/services/messages/MessageTemplateManager.php +++ b/core/domain/services/messages/MessageTemplateManager.php @@ -17,15 +17,15 @@ */ class MessageTemplateManager { - private EEM_Message_Template $message_template_model; + private EEM_Message_Template $message_template_model; - private EEM_Message_Template_Group $message_template_group_model; + private EEM_Message_Template_Group $message_template_group_model; protected MessageTemplateRequestData $form_data; - protected MessageTemplateValidator $validator; + protected MessageTemplateValidator $validator; - protected RequestInterface $request; + protected RequestInterface $request; /** diff --git a/core/domain/services/messages/MessageTemplateRequestData.php b/core/domain/services/messages/MessageTemplateRequestData.php index 0f56dacb4a..3fa7190286 100644 --- a/core/domain/services/messages/MessageTemplateRequestData.php +++ b/core/domain/services/messages/MessageTemplateRequestData.php @@ -16,29 +16,29 @@ class MessageTemplateRequestData { protected ?RequestInterface $request = null; - protected string $context = ''; + protected string $context = ''; - protected string $description = ''; + protected string $description = ''; - protected string $messenger = ''; + protected string $messenger = ''; - protected string $message_type = ''; + protected string $message_type = ''; - protected string $name = ''; + protected string $name = ''; - protected array $template_fields = []; + protected array $template_fields = []; - protected int $group_ID = 0; + protected int $group_ID = 0; - protected int $user_ID = 0; + protected int $user_ID = 0; - protected bool $is_active = false; + protected bool $is_active = false; - protected bool $is_deleted = false; + protected bool $is_deleted = false; - protected bool $is_global = false; + protected bool $is_global = false; - protected bool $is_override = false; + protected bool $is_override = false; /** diff --git a/core/domain/services/validation/email/EmailValidationService.php b/core/domain/services/validation/email/EmailValidationService.php index 9148823b11..afefc2d911 100644 --- a/core/domain/services/validation/email/EmailValidationService.php +++ b/core/domain/services/validation/email/EmailValidationService.php @@ -17,7 +17,7 @@ class EmailValidationService implements EmailValidatorInterface { protected EE_Registration_Config $registration_config; - protected LoaderInterface $loader; + protected LoaderInterface $loader; /** diff --git a/core/domain/services/wp_queries/EventListQuery.php b/core/domain/services/wp_queries/EventListQuery.php index 63954e7824..789898447f 100644 --- a/core/domain/services/wp_queries/EventListQuery.php +++ b/core/domain/services/wp_queries/EventListQuery.php @@ -31,7 +31,7 @@ class EventListQuery extends WP_Query /** * @var array|string|null */ - private $order_by =[]; + private $order_by = []; private ?string $sort = ''; diff --git a/core/domain/values/BaseFormat.php b/core/domain/values/BaseFormat.php index c8b4ac648a..8db93b8025 100644 --- a/core/domain/values/BaseFormat.php +++ b/core/domain/values/BaseFormat.php @@ -21,7 +21,7 @@ protected function sanitizeDateFormat(string $format): string for ($i = 0; $i < strlen($format); $i++) { $char = substr($format, $i, 1); // first check if the previous character was a backslash - if (substr($format, $i-1, 1) === '\\') { + if (substr($format, $i - 1, 1) === '\\') { // escaped characters are allowed $sanitized_format .= "\\$char"; continue; diff --git a/core/domain/values/TimeFormat.php b/core/domain/values/TimeFormat.php index afab505043..a0a3f960dd 100644 --- a/core/domain/values/TimeFormat.php +++ b/core/domain/values/TimeFormat.php @@ -7,7 +7,7 @@ class TimeFormat extends BaseFormat protected const DEFAULT_FORMAT = 'H:i:s'; protected const WORDPRESS_FORMAT_OPTION_NAME = 'time_format'; - protected static array $allowed_chars = [ + protected static array $allowed_chars = [ 'a', 'A', 'B', diff --git a/core/helpers/EEH_Array.helper.php b/core/helpers/EEH_Array.helper.php index 992574d9b7..2edc26d798 100644 --- a/core/helpers/EEH_Array.helper.php +++ b/core/helpers/EEH_Array.helper.php @@ -143,11 +143,11 @@ public static function insert_into_array( // then add the new data // then add another slice that starts at the offset and goes till the end return array_slice($target_array, 0, $offset, true) + $array_to_insert + array_slice( - $target_array, - $offset, - null, - true - ); + $target_array, + $offset, + null, + true + ); } else { // since we don't want to preserve keys, we can use array_splice array_splice($target_array, $offset, 0, $array_to_insert); diff --git a/core/helpers/EEH_Base.helper.php b/core/helpers/EEH_Base.helper.php index 95efc9712f..6002c48b05 100644 --- a/core/helpers/EEH_Base.helper.php +++ b/core/helpers/EEH_Base.helper.php @@ -3,9 +3,9 @@ /** * EEH_Base Helper * - * @package Event Espresso + * @package Event Espresso * @subpackage /helpers/ - * @author Brent Christensen + * @author Brent Christensen * * ------------------------------------------------------------------------ */ @@ -13,13 +13,11 @@ class EEH_Base { /** * @var array $uri_segment_array URL segments - * @access private */ -// final private function __construct() {} /** - * @ override magic methods - * @ return void + * override magic methods + * @return void */ public function __set($a, $b) { diff --git a/core/helpers/EEH_Debug_Tools.helper.php b/core/helpers/EEH_Debug_Tools.helper.php index c8234b5cea..c2a5a6aa90 100644 --- a/core/helpers/EEH_Debug_Tools.helper.php +++ b/core/helpers/EEH_Debug_Tools.helper.php @@ -554,7 +554,7 @@ protected static function pre_span($var) if (EEH_Debug_Tools::plainOutput()) { return rtrim($var, "\n"); } - $style =[ + $style = [ 'background: #334', 'color: #9C3', 'display: inline-block', diff --git a/core/helpers/EEH_MSG_Template.helper.php b/core/helpers/EEH_MSG_Template.helper.php index 2b2f8d43c3..a52c0b518e 100644 --- a/core/helpers/EEH_MSG_Template.helper.php +++ b/core/helpers/EEH_MSG_Template.helper.php @@ -68,7 +68,6 @@ public static function generate_new_templates($messenger, $message_types, $GRP_I EEH_MSG_Template::_set_autoloader(); foreach ($message_types as $message_type) { - // if this is global template generation. if ($global) { // let's attempt to get the GRP_ID for this combo IF GRP_ID is empty. diff --git a/core/helpers/EEH_Template.helper.php b/core/helpers/EEH_Template.helper.php index 4934bcd154..947f3014d0 100644 --- a/core/helpers/EEH_Template.helper.php +++ b/core/helpers/EEH_Template.helper.php @@ -632,9 +632,9 @@ public static function get_help_tab_link( ' . wp_kses($help_text, AllowedTags::getAllowedTags()) . ' '; @@ -922,7 +922,7 @@ public static function powered_by_event_espresso( if ( $request->isActivation() || strpos($request->requestUri(true), 'wp-admin/update.php') !== false - ){ + ) { return ''; } $cache_id = TemplateCache::generateCacheID(__FUNCTION__, func_get_args()); diff --git a/core/libraries/batch/JobHandlerBaseClasses/JobHandlerInterface.php b/core/libraries/batch/JobHandlerBaseClasses/JobHandlerInterface.php index 21625ed576..50ee450f83 100644 --- a/core/libraries/batch/JobHandlerBaseClasses/JobHandlerInterface.php +++ b/core/libraries/batch/JobHandlerBaseClasses/JobHandlerInterface.php @@ -1,6 +1,5 @@ $value) { if (is_array($value)) { - $query_params[$key] = $this->convertDateStringsToObjects($value, $site_timezone, $utc_timezone); + $query_params[ $key ] = $this->convertDateStringsToObjects($value, $site_timezone, $utc_timezone); continue; } if (preg_match('/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/', $value)) { - $query_params[$key] = DbSafeDateTime::createFromFormat('Y-m-d H:i:s', $value, $site_timezone); - $query_params[$key] = $query_params[$key]->setTimezone($utc_timezone); + $query_params[ $key ] = DbSafeDateTime::createFromFormat('Y-m-d H:i:s', $value, $site_timezone); + $query_params[ $key ] = $query_params[ $key ]->setTimezone($utc_timezone); } } return $query_params; diff --git a/core/libraries/form_sections/base/EE_Form_Section_Proper.form.php b/core/libraries/form_sections/base/EE_Form_Section_Proper.form.php index e116757240..68e6da3cd7 100644 --- a/core/libraries/form_sections/base/EE_Form_Section_Proper.form.php +++ b/core/libraries/form_sections/base/EE_Form_Section_Proper.form.php @@ -1264,7 +1264,9 @@ public function add_subsections($new_subsections, $subsection_name_to_target = n $subsection_name, $this->name() ), - __FILE__, __FUNCTION__, __LINE__ + __FILE__, + __FUNCTION__, + __LINE__ ); unset($new_subsections[ $subsection_name ]); } diff --git a/core/libraries/form_sections/inputs/EE_CVV_Input.input.php b/core/libraries/form_sections/inputs/EE_CVV_Input.input.php index 83089078bf..452fda4761 100644 --- a/core/libraries/form_sections/inputs/EE_CVV_Input.input.php +++ b/core/libraries/form_sections/inputs/EE_CVV_Input.input.php @@ -22,9 +22,9 @@ public function __construct($input_settings = []) $this->_add_validation_strategy( new EE_Text_Validation_Strategy( $input_settings['validation_error_message'] ?? esc_html__( - 'The CVV is either a 3 digit number on the back of your card, or 4 digit number on the front', - 'event_espresso' - ), + 'The CVV is either a 3 digit number on the back of your card, or 4 digit number on the front', + 'event_espresso' + ), '~^\d{3,4}$~' ) ); diff --git a/core/libraries/form_sections/inputs/EE_Form_Input_Base.input.php b/core/libraries/form_sections/inputs/EE_Form_Input_Base.input.php index 1eb2ab431d..e1c5a4ba90 100644 --- a/core/libraries/form_sections/inputs/EE_Form_Input_Base.input.php +++ b/core/libraries/form_sections/inputs/EE_Form_Input_Base.input.php @@ -236,14 +236,14 @@ public function __construct($input_args = []) $setter = 'set_' . $key; if (method_exists($this, $setter)) { $this->$setter($value); - unset($input_args[$key]); + unset($input_args[ $key ]); continue; } // add underscore to $key to match property names $_key = "_$key"; if (property_exists($this, $_key)) { $this->{$_key} = $value; - unset($input_args[$key]); + unset($input_args[ $key ]); } } // ensure that "required" is set correctly diff --git a/core/libraries/form_sections/payment_methods/EE_Billing_Attendee_Info_Form.form.php b/core/libraries/form_sections/payment_methods/EE_Billing_Attendee_Info_Form.form.php index 4645138e7b..e22dd984e1 100644 --- a/core/libraries/form_sections/payment_methods/EE_Billing_Attendee_Info_Form.form.php +++ b/core/libraries/form_sections/payment_methods/EE_Billing_Attendee_Info_Form.form.php @@ -68,21 +68,23 @@ public function __construct(EE_Payment_Method $payment_method, $options_array = 'state' => apply_filters( 'FHEE__EE_Billing_Attendee_Info_Form__state_field', new EE_State_Select_Input( - null, [ + null, + [ 'required' => true, 'html_class' => 'ee-billing-qstn ee-billing-qstn-state', 'html_label_text' => esc_html__('State', 'event_espresso'), - ] + ] ) ), 'country' => apply_filters( 'FHEE__EE_Billing_Attendee_Info_Form__country_field', new EE_Country_Select_Input( - null, [ + null, + [ 'required' => true, 'html_class' => 'ee-billing-qstn ee-billing-qstn-country', 'html_label_text' => esc_html__('Country', 'event_espresso'), - ] + ] ) ), 'zip' => new EE_Text_Input( diff --git a/core/libraries/form_sections/strategies/display/EE_Admin_File_Uploader_Display_Strategy.strategy.php b/core/libraries/form_sections/strategies/display/EE_Admin_File_Uploader_Display_Strategy.strategy.php index 4146c8caad..40f68ffc6d 100644 --- a/core/libraries/form_sections/strategies/display/EE_Admin_File_Uploader_Display_Strategy.strategy.php +++ b/core/libraries/form_sections/strategies/display/EE_Admin_File_Uploader_Display_Strategy.strategy.php @@ -18,7 +18,7 @@ class EE_Admin_File_Uploader_Display_Strategy extends EE_Display_Strategy_Base * button to select media). Besides that, no special consideration should be required to make the media uploader * appear, besides having this input displayed. * - * @deprecated. enqueue_js should be called automatically now + * @deprecated enqueue_js should be called automatically now */ public static function enqueue_scripts() { @@ -84,10 +84,10 @@ public function display(): string : ''; // html string return EEH_HTML::div( - $input . $uploader, - '', - 'ee_media_uploader_area' - ) . $image; + $input . $uploader, + '', + 'ee_media_uploader_area' + ) . $image; } diff --git a/core/libraries/form_sections/strategies/display/EE_Checkbox_Dropdown_Selector_Display_Strategy.strategy.php b/core/libraries/form_sections/strategies/display/EE_Checkbox_Dropdown_Selector_Display_Strategy.strategy.php index fbbe1756ec..62296838f9 100644 --- a/core/libraries/form_sections/strategies/display/EE_Checkbox_Dropdown_Selector_Display_Strategy.strategy.php +++ b/core/libraries/form_sections/strategies/display/EE_Checkbox_Dropdown_Selector_Display_Strategy.strategy.php @@ -119,7 +119,7 @@ public function display(): string $html .= ' - 'search-submit']); ?> + 'search-submit']); ?> search_term)) { echo wp_kses($this->generateResetButton($url), AllowedTags::getAllowedTags()); diff --git a/core/services/bootstrap/BootstrapCore.php b/core/services/bootstrap/BootstrapCore.php index 678d5ad165..2822e62a0e 100644 --- a/core/services/bootstrap/BootstrapCore.php +++ b/core/services/bootstrap/BootstrapCore.php @@ -53,15 +53,15 @@ */ class BootstrapCore { - private LoaderInterface $loader; + private LoaderInterface $loader; - protected RequestInterface $request; + protected RequestInterface $request; - protected ResponseInterface $response; + protected ResponseInterface $response; protected RequestStackBuilder $request_stack_builder; - protected RequestStack $request_stack; + protected RequestStack $request_stack; /** diff --git a/core/services/bootstrap/BootstrapDependencyInjectionContainer.php b/core/services/bootstrap/BootstrapDependencyInjectionContainer.php index a7bb468343..a2f06dd1c1 100644 --- a/core/services/bootstrap/BootstrapDependencyInjectionContainer.php +++ b/core/services/bootstrap/BootstrapDependencyInjectionContainer.php @@ -26,15 +26,15 @@ class BootstrapDependencyInjectionContainer { private ClassInterfaceCache $class_cache; - private Mirror $mirror; + private Mirror $mirror; - private ObjectIdentifier $object_identifier; + private ObjectIdentifier $object_identifier; protected EE_Dependency_Map $dependency_map; - protected EE_Registry $registry; + protected EE_Registry $registry; - protected LoaderInterface $loader; + protected LoaderInterface $loader; // /** diff --git a/core/services/bootstrap/BootstrapRequestResponseObjects.php b/core/services/bootstrap/BootstrapRequestResponseObjects.php index 44d1dd5d6a..b2f9a5324d 100644 --- a/core/services/bootstrap/BootstrapRequestResponseObjects.php +++ b/core/services/bootstrap/BootstrapRequestResponseObjects.php @@ -31,11 +31,11 @@ class BootstrapRequestResponseObjects { protected LegacyRequestInterface $legacy_request; - protected LoaderInterface $loader; + protected LoaderInterface $loader; - protected RequestInterface $request; + protected RequestInterface $request; - protected ResponseInterface $response; + protected ResponseInterface $response; /** diff --git a/core/services/database/TableManager.php b/core/services/database/TableManager.php index 4f34d455f1..f75fe89179 100644 --- a/core/services/database/TableManager.php +++ b/core/services/database/TableManager.php @@ -243,7 +243,7 @@ public function createTable(string $table_name, string $create_sql, string $engi * (often true in EE) * @param string|int $index_size defaults to TableAnalysis::index_col_size, the max for utf8mb4. * @return bool whether an index was dropped or not - * @throws /EE_Error if table analysis object isn't defined + * @throws EE_Error if table analysis object isn't defined */ public function dropIndexIfSizeNot( string $table_name, diff --git a/core/services/database/WpdbDataFormat.php b/core/services/database/WpdbDataFormat.php index e2fc9c8294..3f075ead6b 100644 --- a/core/services/database/WpdbDataFormat.php +++ b/core/services/database/WpdbDataFormat.php @@ -50,19 +50,19 @@ public static function getWpdbDataTypeForTypeArray(array $type): string $type = array_flip($type); // check for things that mean '%s' - if (isset($type[SchemaType::STRING], $type[SchemaType::OBJECT], $type[SchemaType::ARRAY])) { + if (isset($type[ SchemaType::STRING ], $type[ SchemaType::OBJECT ], $type[ SchemaType::ARRAY ])) { return WpdbDataFormat::STRING; } // if makes it past the above condition and there's float in the array // then the type is %f - if (isset($type[SchemaType::NUMBER])) { + if (isset($type[ SchemaType::NUMBER ])) { return WpdbDataFormat::FLOAT; } // if it makes it past the above conditions and there is an integer in the array // then the type is %d - if (isset($type[SchemaType::INTEGER])) { + if (isset($type[ SchemaType::INTEGER ])) { return WpdbDataFormat::INTEGER; } diff --git a/core/services/encryption/openssl/CipherMethod.php b/core/services/encryption/openssl/CipherMethod.php index 2f121d35b7..b6294a5f42 100644 --- a/core/services/encryption/openssl/CipherMethod.php +++ b/core/services/encryption/openssl/CipherMethod.php @@ -20,7 +20,7 @@ class CipherMethod * list of cipher methods that we consider usable, * essentially all of the installed_cipher_methods minus weak_algorithms */ - protected array $cipher_methods = []; + protected array $cipher_methods = []; protected string $default_cipher_method = ''; diff --git a/core/services/graphql/GraphQLEndpoint.php b/core/services/graphql/GraphQLEndpoint.php index ef66113f60..0d23203b9c 100644 --- a/core/services/graphql/GraphQLEndpoint.php +++ b/core/services/graphql/GraphQLEndpoint.php @@ -22,7 +22,7 @@ class GraphQLEndpoint extends WordPressOption const OPTION_NAME = 'ee-graphql-endpoint'; - private bool $is_gql_request = false; + private bool $is_gql_request; /** @@ -32,13 +32,22 @@ public function __construct() { parent::__construct(GraphQLEndpoint::OPTION_NAME, GraphQLEndpoint::DEFAULT_ENDPOINT, true); add_action('graphql_register_settings', [$this, 'verifyAndSetEndpoint'], 20); - if (! defined('GRAPHQL_DEBUG') || ! GRAPHQL_DEBUG) { + if (! $this->graphqlDebug()) { // disable WPGraphQL admin by default. add_filter('graphql_show_admin', '__return_false'); add_filter('graphql_enable_graphiql', '__return_false'); } } + /** + * Determine the value of global constant GRAPHQL_DEBUG + * @return bool + */ + private function graphqlDebug(): bool + { + return defined('GRAPHQL_DEBUG') && GRAPHQL_DEBUG; + } + /** * @return false|mixed|void diff --git a/core/services/graphql/GraphQLManager.php b/core/services/graphql/GraphQLManager.php index 2adc376815..4cb543ff2e 100644 --- a/core/services/graphql/GraphQLManager.php +++ b/core/services/graphql/GraphQLManager.php @@ -44,7 +44,7 @@ class GraphQLManager implements GQLManagerInterface * @var InterfaceManager $interface_manager */ protected $interface_manager; - + /** * @var boolean $initialized */ diff --git a/core/services/graphql/InterfaceManager.php b/core/services/graphql/InterfaceManager.php index bd0ec5b423..6db765b6ed 100644 --- a/core/services/graphql/InterfaceManager.php +++ b/core/services/graphql/InterfaceManager.php @@ -64,9 +64,9 @@ protected function fieldsToArray(GraphQLInterfaceInterface $interface): array $array = []; foreach ($interface->getFields() as $f) { $name = $f->name(); - $array[$name] = $f->toArray(); + $array[ $name ] = $f->toArray(); if ($f->useForOutput()) { - $array[$name]['resolve'] = [$interface, $this->methodName]; + $array[ $name ]['resolve'] = [$interface, $this->methodName]; } } return $array; diff --git a/core/services/graphql/types/TypeBase.php b/core/services/graphql/types/TypeBase.php index 94747b5803..190f902028 100644 --- a/core/services/graphql/types/TypeBase.php +++ b/core/services/graphql/types/TypeBase.php @@ -40,27 +40,27 @@ abstract class TypeBase implements TypeInterface /** * The graphql namespace/prefix. */ - protected string $namespace = 'Espresso'; + protected string $namespace = 'Espresso'; protected ?EEM_Base $model = null; - protected string $name = ''; + protected string $name = ''; - protected string $description = ''; + protected string $description = ''; /** * @var GraphQLFieldInterface[] $fields */ - protected array $fields = []; + protected array $fields = []; /** * @var GraphQLInterfaceInterface[] $interfaces */ - protected array $interfaces = []; + protected array $interfaces = []; protected FieldResolver $field_resolver; - protected bool $is_custom_post_type = false; + protected bool $is_custom_post_type = false; /** diff --git a/core/services/helpers/DebugDisplay.php b/core/services/helpers/DebugDisplay.php index 87e4ff4e57..95943a39fa 100644 --- a/core/services/helpers/DebugDisplay.php +++ b/core/services/helpers/DebugDisplay.php @@ -24,7 +24,7 @@ trait DebugDisplay public function initializeDebugDisplay(int $threshold = 0, ?array $levels = null) { - $this->threshold = defined('WP_DEBUG') && WP_DEBUG ? $threshold: 0; + $this->threshold = defined('WP_DEBUG') && WP_DEBUG ? $threshold : 0; $this->levels = $levels ?: $this->levels; } diff --git a/core/services/helpers/WordPressHooks.php b/core/services/helpers/WordPressHooks.php index 737d76f1e0..ca411f85f2 100644 --- a/core/services/helpers/WordPressHooks.php +++ b/core/services/helpers/WordPressHooks.php @@ -35,4 +35,4 @@ public static function getClassNamesForAllCallbacksOnHook(string $hook): array } return $class_names; } -} \ No newline at end of file +} diff --git a/core/services/licensing/AddonLicense.php b/core/services/licensing/AddonLicense.php index 3e5c2675d6..a36f566b73 100644 --- a/core/services/licensing/AddonLicense.php +++ b/core/services/licensing/AddonLicense.php @@ -25,7 +25,7 @@ class AddonLicense * @var array|string[] */ private static array $addon_names = [ - //Add-ons + // Add-ons 'eea-affiliate-wp' => 'AffiliateWP Integration', 'eea-attendee-mover' => 'Attendee Mover', 'eea-automated-upcoming-event-notification' => 'Automatic Event Notifications', diff --git a/core/services/licensing/PluginLicenseCollection.php b/core/services/licensing/PluginLicenseCollection.php index e26fb02395..b04eba2055 100644 --- a/core/services/licensing/PluginLicenseCollection.php +++ b/core/services/licensing/PluginLicenseCollection.php @@ -23,4 +23,4 @@ public function loadPluginLicenses() $this ); } -} \ No newline at end of file +} diff --git a/core/services/licensing/SamplePlugin.php b/core/services/licensing/SamplePlugin.php index 56947ce331..207b07cb67 100644 --- a/core/services/licensing/SamplePlugin.php +++ b/core/services/licensing/SamplePlugin.php @@ -16,52 +16,52 @@ */ // this is the URL our updater / license checker pings. This should be the URL of the site with EDD installed -define( 'EDD_SAMPLE_STORE_URL', 'http://easydigitaldownloads.com' ); // you should use your own CONSTANT name, and be sure to replace it throughout this file +define('EDD_SAMPLE_STORE_URL', 'http://easydigitaldownloads.com'); // you should use your own CONSTANT name, and be sure to replace it throughout this file // the download ID for the product in Easy Digital Downloads -define( 'EDD_SAMPLE_ITEM_ID', 123 ); // you should use your own CONSTANT name, and be sure to replace it throughout this file +define('EDD_SAMPLE_ITEM_ID', 123); // you should use your own CONSTANT name, and be sure to replace it throughout this file // the name of the product in Easy Digital Downloads -define( 'EDD_SAMPLE_ITEM_NAME', 'Sample Plugin' ); // you should use your own CONSTANT name, and be sure to replace it throughout this file +define('EDD_SAMPLE_ITEM_NAME', 'Sample Plugin'); // you should use your own CONSTANT name, and be sure to replace it throughout this file // the name of the settings page for the license input to be displayed -define( 'EDD_SAMPLE_PLUGIN_LICENSE_PAGE', 'pluginname-license' ); +define('EDD_SAMPLE_PLUGIN_LICENSE_PAGE', 'pluginname-license'); -if ( ! class_exists( 'EDD_SL_Plugin_Updater' ) ) { - // load our custom updater - include dirname( __FILE__ ) . '/EDD_SL_Plugin_Updater.php'; +if (! class_exists('EDD_SL_Plugin_Updater')) { + // load our custom updater + include dirname(__FILE__) . '/EDD_SL_Plugin_Updater.php'; } /** * Initialize the updater. Hooked into `init` to work with the * wp_version_check cron job, which allows auto-updates. */ -function edd_sl_sample_plugin_updater() { - - // To support auto-updates, this needs to run during the wp_version_check cron job for privileged users. - $doing_cron = defined( 'DOING_CRON' ) && DOING_CRON; - if ( ! current_user_can( 'manage_options' ) && ! $doing_cron ) { - return; - } - - // retrieve our license key from the DB - $license_key = trim( get_option( 'edd_sample_license_key' ) ); - - // setup the updater - $edd_updater = new EDD_SL_Plugin_Updater( - EDD_SAMPLE_STORE_URL, - __FILE__, - array( - 'version' => '1.0', // current version number - 'license' => $license_key, // license key (used get_option above to retrieve from DB) - 'item_id' => EDD_SAMPLE_ITEM_ID, // ID of the product - 'author' => 'Easy Digital Downloads', // author of this plugin - 'beta' => false, - ) - ); - +function edd_sl_sample_plugin_updater() +{ + + // To support auto-updates, this needs to run during the wp_version_check cron job for privileged users. + $doing_cron = defined('DOING_CRON') && DOING_CRON; + if (! current_user_can('manage_options') && ! $doing_cron) { + return; + } + + // retrieve our license key from the DB + $license_key = trim(get_option('edd_sample_license_key')); + + // setup the updater + $edd_updater = new EDD_SL_Plugin_Updater( + EDD_SAMPLE_STORE_URL, + __FILE__, + array( + 'version' => '1.0', // current version number + 'license' => $license_key, // license key (used get_option above to retrieve from DB) + 'item_id' => EDD_SAMPLE_ITEM_ID, // ID of the product + 'author' => 'Easy Digital Downloads', // author of this plugin + 'beta' => false, + ) + ); } -add_action( 'init', 'edd_sl_sample_plugin_updater' ); +add_action('init', 'edd_sl_sample_plugin_updater'); /************************************ @@ -75,44 +75,46 @@ function edd_sl_sample_plugin_updater() { * * @return void */ -function edd_sample_license_menu() { - add_plugins_page( - __( 'Plugin License' ), - __( 'Plugin License' ), - 'manage_options', - EDD_SAMPLE_PLUGIN_LICENSE_PAGE, - 'edd_sample_license_page' - ); +function edd_sample_license_menu() +{ + add_plugins_page( + __('Plugin License'), + __('Plugin License'), + 'manage_options', + EDD_SAMPLE_PLUGIN_LICENSE_PAGE, + 'edd_sample_license_page' + ); } -add_action( 'admin_menu', 'edd_sample_license_menu' ); - -function edd_sample_license_page() { - add_settings_section( - 'edd_sample_license', - __( 'Plugin License' ), - 'edd_sample_license_key_settings_section', - EDD_SAMPLE_PLUGIN_LICENSE_PAGE - ); - add_settings_field( - 'edd_sample_license_key', - '', - 'edd_sample_license_key_settings_field', - EDD_SAMPLE_PLUGIN_LICENSE_PAGE, - 'edd_sample_license', - ); - ?> -
-

-
- - - - - ' . __('License Key') . '', + 'edd_sample_license_key_settings_field', + EDD_SAMPLE_PLUGIN_LICENSE_PAGE, + 'edd_sample_license', + ); + ?> +
+

+
+ + + + + -

- ', - esc_attr( $license ) - ); - $button = array( - 'name' => 'edd_license_deactivate', - 'label' => __( 'Deactivate License' ), - ); - if ( 'valid' !== $status ) { - $button = array( - 'name' => 'edd_license_activate', - 'label' => __( 'Activate License' ), - ); - } - wp_nonce_field( 'edd_sample_nonce', 'edd_sample_nonce' ); - ?> - - +

+ ', + esc_attr($license) + ); + $button = array( + 'name' => 'edd_license_deactivate', + 'label' => __('Deactivate License'), + ); + if ('valid' !== $status) { + $button = array( + 'name' => 'edd_license_activate', + 'label' => __('Activate License'), + ); + } + wp_nonce_field('edd_sample_nonce', 'edd_sample_nonce'); + ?> + + 'activate_license', - 'license' => $license, - 'item_id' => EDD_SAMPLE_ITEM_ID, - 'item_name' => rawurlencode( EDD_SAMPLE_ITEM_NAME ), // the name of our product in EDD - 'url' => home_url(), - 'environment' => function_exists( 'wp_get_environment_type' ) ? wp_get_environment_type() : 'production', - ); - - // Call the custom API. - $response = wp_remote_post( - EDD_SAMPLE_STORE_URL, - array( - 'timeout' => 15, - 'sslverify' => false, - 'body' => $api_params, - ) - ); - - // make sure the response came back okay - if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { - - if ( is_wp_error( $response ) ) { - $message = $response->get_error_message(); - } else { - $message = __( 'An error occurred, please try again.' ); - } - } else { - - $license_data = json_decode( wp_remote_retrieve_body( $response ) ); - - if ( false === $license_data->success ) { - - switch ( $license_data->error ) { - - case 'expired': - $message = sprintf( - /* translators: the license key expiration date */ - __( 'Your license key expired on %s.', 'edd-sample-plugin' ), - date_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) ) - ); - break; - - case 'disabled': - case 'revoked': - $message = __( 'Your license key has been disabled.', 'edd-sample-plugin' ); - break; - - case 'missing': - $message = __( 'Invalid license.', 'edd-sample-plugin' ); - break; - - case 'invalid': - case 'site_inactive': - $message = __( 'Your license is not active for this URL.', 'edd-sample-plugin' ); - break; - - case 'item_name_mismatch': - /* translators: the plugin name */ - $message = sprintf( __( 'This appears to be an invalid license key for %s.', 'edd-sample-plugin' ), EDD_SAMPLE_ITEM_NAME ); - break; - - case 'no_activations_left': - $message = __( 'Your license key has reached its activation limit.', 'edd-sample-plugin' ); - break; - - default: - $message = __( 'An error occurred, please try again.', 'edd-sample-plugin' ); - break; - } - } - } - - // Check if anything passed on a message constituting a failure - if ( ! empty( $message ) ) { - $redirect = add_query_arg( - array( - 'page' => EDD_SAMPLE_PLUGIN_LICENSE_PAGE, - 'sl_activation' => 'false', - 'message' => rawurlencode( $message ), - ), - admin_url( 'plugins.php' ) - ); - - wp_safe_redirect( $redirect ); - exit(); - } - - // $license_data->license will be either "valid" or "invalid" - if ( 'valid' === $license_data->license ) { - update_option( 'edd_sample_license_key', $license ); - } - update_option( 'edd_sample_license_status', $license_data->license ); - wp_safe_redirect( admin_url( 'plugins.php?page=' . EDD_SAMPLE_PLUGIN_LICENSE_PAGE ) ); - exit(); +function edd_sample_activate_license() +{ + + // listen for our activate button to be clicked + if (! isset($_POST['edd_license_activate'])) { + return; + } + + // run a quick security check + if (! check_admin_referer('edd_sample_nonce', 'edd_sample_nonce')) { + return; // get out if we didn't click the Activate button + } + + // retrieve the license from the database + $license = trim(get_option('edd_sample_license_key')); + if (! $license) { + $license = ! empty($_POST['edd_sample_license_key']) ? sanitize_text_field($_POST['edd_sample_license_key']) : ''; + } + if (! $license) { + return; + } + + // data to send in our API request + $api_params = array( + 'edd_action' => 'activate_license', + 'license' => $license, + 'item_id' => EDD_SAMPLE_ITEM_ID, + 'item_name' => rawurlencode(EDD_SAMPLE_ITEM_NAME), // the name of our product in EDD + 'url' => home_url(), + 'environment' => function_exists('wp_get_environment_type') ? wp_get_environment_type() : 'production', + ); + + // Call the custom API. + $response = wp_remote_post( + EDD_SAMPLE_STORE_URL, + array( + 'timeout' => 15, + 'sslverify' => false, + 'body' => $api_params, + ) + ); + + // make sure the response came back okay + if (is_wp_error($response) || 200 !== wp_remote_retrieve_response_code($response)) { + if (is_wp_error($response)) { + $message = $response->get_error_message(); + } else { + $message = __('An error occurred, please try again.'); + } + } else { + $license_data = json_decode(wp_remote_retrieve_body($response)); + + if (false === $license_data->success) { + switch ($license_data->error) { + case 'expired': + $message = sprintf( + /* translators: the license key expiration date */ + __('Your license key expired on %s.', 'edd-sample-plugin'), + date_i18n(get_option('date_format'), strtotime($license_data->expires, current_time('timestamp'))) + ); + break; + + case 'disabled': + case 'revoked': + $message = __('Your license key has been disabled.', 'edd-sample-plugin'); + break; + + case 'missing': + $message = __('Invalid license.', 'edd-sample-plugin'); + break; + + case 'invalid': + case 'site_inactive': + $message = __('Your license is not active for this URL.', 'edd-sample-plugin'); + break; + + case 'item_name_mismatch': + /* translators: the plugin name */ + $message = sprintf(__('This appears to be an invalid license key for %s.', 'edd-sample-plugin'), EDD_SAMPLE_ITEM_NAME); + break; + + case 'no_activations_left': + $message = __('Your license key has reached its activation limit.', 'edd-sample-plugin'); + break; + + default: + $message = __('An error occurred, please try again.', 'edd-sample-plugin'); + break; + } + } + } + + // Check if anything passed on a message constituting a failure + if (! empty($message)) { + $redirect = add_query_arg( + array( + 'page' => EDD_SAMPLE_PLUGIN_LICENSE_PAGE, + 'sl_activation' => 'false', + 'message' => rawurlencode($message), + ), + admin_url('plugins.php') + ); + + wp_safe_redirect($redirect); + exit(); + } + + // $license_data->license will be either "valid" or "invalid" + if ('valid' === $license_data->license) { + update_option('edd_sample_license_key', $license); + } + update_option('edd_sample_license_status', $license_data->license); + wp_safe_redirect(admin_url('plugins.php?page=' . EDD_SAMPLE_PLUGIN_LICENSE_PAGE)); + exit(); } -add_action( 'admin_init', 'edd_sample_activate_license' ); +add_action('admin_init', 'edd_sample_activate_license'); /** * Deactivates the license key. @@ -312,75 +315,73 @@ function edd_sample_activate_license() { * * @return void */ -function edd_sample_deactivate_license() { - - // listen for our activate button to be clicked - if ( isset( $_POST['edd_license_deactivate'] ) ) { - - // run a quick security check - if ( ! check_admin_referer( 'edd_sample_nonce', 'edd_sample_nonce' ) ) { - return; // get out if we didn't click the Activate button - } - - // retrieve the license from the database - $license = trim( get_option( 'edd_sample_license_key' ) ); - - // data to send in our API request - $api_params = array( - 'edd_action' => 'deactivate_license', - 'license' => $license, - 'item_id' => EDD_SAMPLE_ITEM_ID, - 'item_name' => rawurlencode( EDD_SAMPLE_ITEM_NAME ), // the name of our product in EDD - 'url' => home_url(), - 'environment' => function_exists( 'wp_get_environment_type' ) ? wp_get_environment_type() : 'production', - ); - - // Call the custom API. - $response = wp_remote_post( - EDD_SAMPLE_STORE_URL, - array( - 'timeout' => 15, - 'sslverify' => false, - 'body' => $api_params, - ) - ); - - // make sure the response came back okay - if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { - - if ( is_wp_error( $response ) ) { - $message = $response->get_error_message(); - } else { - $message = __( 'An error occurred, please try again.' ); - } - - $redirect = add_query_arg( - array( - 'page' => EDD_SAMPLE_PLUGIN_LICENSE_PAGE, - 'sl_activation' => 'false', - 'message' => rawurlencode( $message ), - ), - admin_url( 'plugins.php' ) - ); - - wp_safe_redirect( $redirect ); - exit(); - } - - // decode the license data - $license_data = json_decode( wp_remote_retrieve_body( $response ) ); - - // $license_data->license will be either "deactivated" or "failed" - if ( 'deactivated' === $license_data->license ) { - delete_option( 'edd_sample_license_status' ); - } - - wp_safe_redirect( admin_url( 'plugins.php?page=' . EDD_SAMPLE_PLUGIN_LICENSE_PAGE ) ); - exit(); - - } +function edd_sample_deactivate_license() +{ + + // listen for our activate button to be clicked + if (isset($_POST['edd_license_deactivate'])) { + // run a quick security check + if (! check_admin_referer('edd_sample_nonce', 'edd_sample_nonce')) { + return; // get out if we didn't click the Activate button + } + + // retrieve the license from the database + $license = trim(get_option('edd_sample_license_key')); + + // data to send in our API request + $api_params = array( + 'edd_action' => 'deactivate_license', + 'license' => $license, + 'item_id' => EDD_SAMPLE_ITEM_ID, + 'item_name' => rawurlencode(EDD_SAMPLE_ITEM_NAME), // the name of our product in EDD + 'url' => home_url(), + 'environment' => function_exists('wp_get_environment_type') ? wp_get_environment_type() : 'production', + ); + + // Call the custom API. + $response = wp_remote_post( + EDD_SAMPLE_STORE_URL, + array( + 'timeout' => 15, + 'sslverify' => false, + 'body' => $api_params, + ) + ); + + // make sure the response came back okay + if (is_wp_error($response) || 200 !== wp_remote_retrieve_response_code($response)) { + if (is_wp_error($response)) { + $message = $response->get_error_message(); + } else { + $message = __('An error occurred, please try again.'); + } + + $redirect = add_query_arg( + array( + 'page' => EDD_SAMPLE_PLUGIN_LICENSE_PAGE, + 'sl_activation' => 'false', + 'message' => rawurlencode($message), + ), + admin_url('plugins.php') + ); + + wp_safe_redirect($redirect); + exit(); + } + + // decode the license data + $license_data = json_decode(wp_remote_retrieve_body($response)); + + // $license_data->license will be either "deactivated" or "failed" + if ('deactivated' === $license_data->license) { + delete_option('edd_sample_license_status'); + } + + wp_safe_redirect(admin_url('plugins.php?page=' . EDD_SAMPLE_PLUGIN_LICENSE_PAGE)); + exit(); + } } -add_action( 'admin_init', 'edd_sample_deactivate_license' ); +add_action('admin_init', 'edd_sample_deactivate_license'); /** * Checks if a license key is still valid. @@ -389,69 +390,68 @@ function edd_sample_deactivate_license() { * * @return void */ -function edd_sample_check_license() { - - $license = trim( get_option( 'edd_sample_license_key' ) ); - - $api_params = array( - 'edd_action' => 'check_license', - 'license' => $license, - 'item_id' => EDD_SAMPLE_ITEM_ID, - 'item_name' => rawurlencode( EDD_SAMPLE_ITEM_NAME ), - 'url' => home_url(), - 'environment' => function_exists( 'wp_get_environment_type' ) ? wp_get_environment_type() : 'production', - ); - - // Call the custom API. - $response = wp_remote_post( - EDD_SAMPLE_STORE_URL, - array( - 'timeout' => 15, - 'sslverify' => false, - 'body' => $api_params, - ) - ); - - if ( is_wp_error( $response ) ) { - return false; - } - - $license_data = json_decode( wp_remote_retrieve_body( $response ) ); - - if ( 'valid' === $license_data->license ) { - echo 'valid'; - exit; - // this license is still valid - } else { - echo 'invalid'; - exit; - // this license is no longer valid - } +function edd_sample_check_license() +{ + + $license = trim(get_option('edd_sample_license_key')); + + $api_params = array( + 'edd_action' => 'check_license', + 'license' => $license, + 'item_id' => EDD_SAMPLE_ITEM_ID, + 'item_name' => rawurlencode(EDD_SAMPLE_ITEM_NAME), + 'url' => home_url(), + 'environment' => function_exists('wp_get_environment_type') ? wp_get_environment_type() : 'production', + ); + + // Call the custom API. + $response = wp_remote_post( + EDD_SAMPLE_STORE_URL, + array( + 'timeout' => 15, + 'sslverify' => false, + 'body' => $api_params, + ) + ); + + if (is_wp_error($response)) { + return false; + } + + $license_data = json_decode(wp_remote_retrieve_body($response)); + + if ('valid' === $license_data->license) { + echo 'valid'; + exit; + // this license is still valid + } else { + echo 'invalid'; + exit; + // this license is no longer valid + } } /** * This is a means of catching errors from the activation method above and displaying it to the customer */ -function edd_sample_admin_notices() { - if ( isset( $_GET['sl_activation'] ) && ! empty( $_GET['message'] ) ) { - - switch ( $_GET['sl_activation'] ) { - - case 'false': - $message = urldecode( $_GET['message'] ); - ?> -
-

-
- +
+

+
+ FQCNs[] = Psr4Autoloader::NS . str_replace( - [$base_dir, '/'], - [$namespace, Psr4Autoloader::NS], - $file - ); + [$base_dir, '/'], + [$namespace, Psr4Autoloader::NS], + $file + ); } } } diff --git a/core/services/modules/LegacyModulesManager.php b/core/services/modules/LegacyModulesManager.php index 1c9cc688de..5a59959882 100644 --- a/core/services/modules/LegacyModulesManager.php +++ b/core/services/modules/LegacyModulesManager.php @@ -149,5 +149,4 @@ public function initializeModules() } } } - } diff --git a/core/services/modules/ModuleRoutesManager.php b/core/services/modules/ModuleRoutesManager.php index d1c9f7513f..6327698366 100644 --- a/core/services/modules/ModuleRoutesManager.php +++ b/core/services/modules/ModuleRoutesManager.php @@ -195,7 +195,7 @@ public function registerForward($forward, string $route, string $key = 'ee', int } if (! method_exists($forward[0], $forward[1])) { $msg = sprintf( - esc_html__('The class method %s for the %s forwarding route is in invalid.', 'event_espresso'), + esc_html__('The class method %1$s for the %2$s forwarding route is in invalid.', 'event_espresso'), $forward[1], $route ); @@ -204,7 +204,7 @@ public function registerForward($forward, string $route, string $key = 'ee', int } } elseif (! function_exists($forward)) { $msg = sprintf( - esc_html__('The function %s for the %s forwarding route is in invalid.', 'event_espresso'), + esc_html__('The function %1$s for the %2$s forwarding route is in invalid.', 'event_espresso'), $forward, $route ); diff --git a/core/services/payments/IpnHandler.php b/core/services/payments/IpnHandler.php index 480572c584..8b8a9d42f9 100644 --- a/core/services/payments/IpnHandler.php +++ b/core/services/payments/IpnHandler.php @@ -338,7 +338,7 @@ private function invalidPaymentError() EE_Error::add_error( sprintf( esc_html__( - 'A valid payment method could not be determined due to a technical issue.%sPlease refresh your browser and try again or contact %s for assistance.', + 'A valid payment method could not be determined due to a technical issue.%1$sPlease refresh your browser and try again or contact %2$s for assistance.', 'event_espresso' ), '
', @@ -406,5 +406,4 @@ private function removeUnusableCharacters(string $request_data): string { return preg_replace('/[^[:print:]]/', '', $request_data); } - } diff --git a/core/services/payments/PaymentProcessor.php b/core/services/payments/PaymentProcessor.php index 4875351d06..6af0794011 100644 --- a/core/services/payments/PaymentProcessor.php +++ b/core/services/payments/PaymentProcessor.php @@ -29,8 +29,6 @@ */ class PaymentProcessor { - - private EEM_Payment_Method $payment_method_model; private EEM_Transaction $transaction_model; @@ -159,7 +157,7 @@ public function processPayment( EE_Error::add_error( sprintf( esc_html__( - 'A valid payment method could not be determined due to a technical issue.%sPlease try again or contact %s for assistance.', + 'A valid payment method could not be determined due to a technical issue.%1$sPlease try again or contact %2$s for assistance.', 'event_espresso' ), '
', diff --git a/core/services/payments/PaymentProcessorFees.php b/core/services/payments/PaymentProcessorFees.php index 695e65b405..8fca085e1c 100644 --- a/core/services/payments/PaymentProcessorFees.php +++ b/core/services/payments/PaymentProcessorFees.php @@ -175,7 +175,7 @@ private function isPartnerGateway(string $payment_method_name): bool */ private function getGatewayFee(string $payment_method_name, string $license_status): float { - if (isset($this->gateway_fees[ $license_status ][ $payment_method_name ] )) { + if (isset($this->gateway_fees[ $license_status ][ $payment_method_name ])) { return $this->gateway_fees[ $license_status ][ $payment_method_name ]; } throw new OutOfBoundsException( diff --git a/core/services/payments/RegistrationPayments.php b/core/services/payments/RegistrationPayments.php index 4d31526224..a94a9a6e81 100644 --- a/core/services/payments/RegistrationPayments.php +++ b/core/services/payments/RegistrationPayments.php @@ -22,7 +22,6 @@ */ class RegistrationPayments { - /** * update registrations REG_paid field after successful payment and link registrations with payment * diff --git a/core/services/request/CurrentPage.php b/core/services/request/CurrentPage.php index e4ac7f16df..f6f3c3978b 100644 --- a/core/services/request/CurrentPage.php +++ b/core/services/request/CurrentPage.php @@ -22,17 +22,17 @@ */ class CurrentPage { - private EE_CPT_Strategy $cpt_strategy; + private EE_CPT_Strategy $cpt_strategy; - private bool $initialized; + private bool $initialized; - private ?bool $is_espresso_page = null; + private ?bool $is_espresso_page = null; - private int $post_id = 0; + private int $post_id = 0; - private string $post_name = ''; + private string $post_name = ''; - private array $post_type = []; + private array $post_type = []; private RequestInterface $request; diff --git a/core/services/request/RequestStack.php b/core/services/request/RequestStack.php index b67491e16d..b7b5468d6b 100644 --- a/core/services/request/RequestStack.php +++ b/core/services/request/RequestStack.php @@ -14,13 +14,13 @@ */ class RequestStack { - protected RequestDecoratorInterface $request_stack_app; + protected RequestDecoratorInterface $request_stack_app; - protected RequestInterface $request; + protected RequestInterface $request; protected RequestStackCoreAppInterface $core_app; - protected ResponseInterface $response; + protected ResponseInterface $response; /** diff --git a/core/services/request/Response.php b/core/services/request/Response.php index faeb8b2c6e..5809659cf9 100644 --- a/core/services/request/Response.php +++ b/core/services/request/Response.php @@ -14,7 +14,7 @@ */ class Response implements ResponseInterface, ReservedInstanceInterface { - protected bool $deactivate_plugin = false; + protected bool $deactivate_plugin = false; protected array $notice = []; @@ -25,7 +25,7 @@ class Response implements ResponseInterface, ReservedInstanceInterface protected array $request_headers = []; - protected bool $request_terminated = false; + protected bool $request_terminated = false; /** diff --git a/core/services/request/middleware/Middleware.php b/core/services/request/middleware/Middleware.php index b99f97c577..42e2ce64d3 100644 --- a/core/services/request/middleware/Middleware.php +++ b/core/services/request/middleware/Middleware.php @@ -24,13 +24,13 @@ */ abstract class Middleware implements RequestDecoratorInterface { - protected LoaderInterface $loader; + protected LoaderInterface $loader; protected RequestDecoratorInterface $request_stack_app; - protected RequestInterface $request; + protected RequestInterface $request; - protected ResponseInterface $response; + protected ResponseInterface $response; /** diff --git a/core/services/request/sanitizers/RequestSanitizer.php b/core/services/request/sanitizers/RequestSanitizer.php index 28a2c338cf..cf76af4830 100644 --- a/core/services/request/sanitizers/RequestSanitizer.php +++ b/core/services/request/sanitizers/RequestSanitizer.php @@ -7,7 +7,6 @@ class RequestSanitizer { - private Basic $email_validator; diff --git a/core/services/routing/Router.php b/core/services/routing/Router.php index f79a629e5d..12c67f6420 100644 --- a/core/services/routing/Router.php +++ b/core/services/routing/Router.php @@ -31,13 +31,13 @@ class Router { protected EE_Dependency_Map $dependency_map; - protected LoaderInterface $loader; + protected LoaderInterface $loader; - protected RouteHandler $route_handler; + protected RouteHandler $route_handler; - protected string $route_request_type; + protected string $route_request_type; - protected array $routes_loaded; + protected array $routes_loaded; /** diff --git a/core/services/widgets/LegacyWidgetsManager.php b/core/services/widgets/LegacyWidgetsManager.php index a10f595430..2d79efcf72 100644 --- a/core/services/widgets/LegacyWidgetsManager.php +++ b/core/services/widgets/LegacyWidgetsManager.php @@ -99,7 +99,7 @@ public function registerWidget(string $widget_path = '') if (! is_readable($widget_path . '/' . $widget_class . $widget_ext)) { $msg = sprintf( esc_html__( - 'The requested %s widget file could not be found or is not readable due to file permissions. Please ensure the following path is correct: %s', + 'The requested %1$s widget file could not be found or is not readable due to file permissions. Please ensure the following path is correct: %2$s', 'event_espresso' ), $widget_class, diff --git a/espresso.php b/espresso.php index e8373494e3..e1e7541819 100644 --- a/espresso.php +++ b/espresso.php @@ -3,7 +3,7 @@ Plugin Name: Event Espresso Plugin URI: https://eventespresso.com/pricing/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=wordpress_plugins_page&utm_content=support_link Description: Manage events, sell tickets, and receive payments from your WordPress website. Reduce event administration time, cut-out ticketing fees, and own your customer data. | Extensions | Sales | Support - Version: 5.0.27.rc.000 + Version: 5.0.27.rc.006 Author: Event Espresso Author URI: https://eventespresso.com/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=wordpress_plugins_page&utm_content=support_link License: GPLv3 @@ -46,13 +46,13 @@ function espresso_duplicate_plugin_error() { ?>
-

- + -

+

-

- + ', 'https://php.net/downloads.php' ); - ?> -

+ ?> +

getDefinitions(); EED_Module::registerRoute( - $custom_post_types[EspressoPostType::EVENTS]['singular_slug'], + $custom_post_types[ EspressoPostType::EVENTS ]['singular_slug'], 'Event_Single', 'run' ); diff --git a/modules/events_archive/EED_Events_Archive.module.php b/modules/events_archive/EED_Events_Archive.module.php index fe8f63f2ad..1c12fd439e 100644 --- a/modules/events_archive/EED_Events_Archive.module.php +++ b/modules/events_archive/EED_Events_Archive.module.php @@ -78,7 +78,7 @@ public static function set_hooks() $custom_post_type_definitions = LoaderFactory::getLoader()->getShared(CustomPostTypeDefinitions::class); $custom_post_types = $custom_post_type_definitions->getDefinitions(); EED_Module::registerRoute( - $custom_post_types[EspressoPostType::EVENTS]['plural_slug'], + $custom_post_types[ EspressoPostType::EVENTS ]['plural_slug'], 'Events_Archive', 'run' ); diff --git a/modules/single_page_checkout/EED_Single_Page_Checkout.module.php b/modules/single_page_checkout/EED_Single_Page_Checkout.module.php index e575dc111f..ae4b1ec1d8 100644 --- a/modules/single_page_checkout/EED_Single_Page_Checkout.module.php +++ b/modules/single_page_checkout/EED_Single_Page_Checkout.module.php @@ -1474,8 +1474,8 @@ private function _display_spco_reg_form() // add powered by EE msg add_action('AHEE__SPCO__reg_form_footer', ['EED_Single_Page_Checkout', 'display_registration_footer']); $empty_cart = count( - $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params) - ) < 1; + $this->checkout->transaction->registrations($this->checkout->reg_cache_where_params) + ) < 1; EE_Registry::$i18n_js_strings['empty_cart'] = $empty_cart; $cookies_not_set_msg = ''; if ($empty_cart) { diff --git a/modules/single_page_checkout/inc/EE_Checkout.class.php b/modules/single_page_checkout/inc/EE_Checkout.class.php index 4a0da542fb..e615ab8708 100644 --- a/modules/single_page_checkout/inc/EE_Checkout.class.php +++ b/modules/single_page_checkout/inc/EE_Checkout.class.php @@ -466,7 +466,7 @@ public function set_current_step(string $current_step) // grab what step we're on $this->current_step = $this->reg_steps[ $current_step ] ?? reset($this->reg_steps); // verify instance - if (! $this->current_step instanceof EE_SPCO_Reg_Step) { + if (! $this->current_step instanceof EE_SPCO_Reg_Step) { EE_Error::add_error( esc_html__('The current step could not be set.', 'event_espresso'), __FILE__, diff --git a/modules/venue_single/EED_Venue_Single.module.php b/modules/venue_single/EED_Venue_Single.module.php index 4058414195..dac1af672c 100644 --- a/modules/venue_single/EED_Venue_Single.module.php +++ b/modules/venue_single/EED_Venue_Single.module.php @@ -54,7 +54,7 @@ public static function set_hooks() ); $custom_post_types = $custom_post_type_definitions->getDefinitions(); EED_Module::registerRoute( - $custom_post_types[EspressoPostType::VENUES]['singular_slug'], + $custom_post_types[ EspressoPostType::VENUES ]['singular_slug'], 'Venue_Single', 'run' ); diff --git a/modules/venues_archive/EED_Venues_Archive.module.php b/modules/venues_archive/EED_Venues_Archive.module.php index 8660dc43d6..44f347b87b 100644 --- a/modules/venues_archive/EED_Venues_Archive.module.php +++ b/modules/venues_archive/EED_Venues_Archive.module.php @@ -54,7 +54,7 @@ public static function set_hooks() ); $custom_post_types = $custom_post_type_definitions->getDefinitions(); EED_Module::registerRoute( - $custom_post_types[EspressoPostType::VENUES]['plural_slug'], + $custom_post_types[ EspressoPostType::VENUES ]['plural_slug'], 'Venues_Archive', 'run' ); diff --git a/payment_methods/Admin_Only/EE_PMT_Admin_Only.pm.php b/payment_methods/Admin_Only/EE_PMT_Admin_Only.pm.php index ca8155adc4..3373493c58 100644 --- a/payment_methods/Admin_Only/EE_PMT_Admin_Only.pm.php +++ b/payment_methods/Admin_Only/EE_PMT_Admin_Only.pm.php @@ -35,7 +35,8 @@ public function __construct($pm_instance = null) * @throws ReflectionException */ public function generate_new_billing_form(EE_Transaction $transaction = null) - { return null; + { + return null; } diff --git a/payment_methods/Bank/EE_PMT_Bank.pm.php b/payment_methods/Bank/EE_PMT_Bank.pm.php index 41954dd3ca..e387cfa165 100644 --- a/payment_methods/Bank/EE_PMT_Bank.pm.php +++ b/payment_methods/Bank/EE_PMT_Bank.pm.php @@ -35,7 +35,8 @@ public function __construct($pm_instance = null) * @throws ReflectionException */ public function generate_new_billing_form(EE_Transaction $transaction = null) - { return null; + { + return null; } diff --git a/payment_methods/Check/EE_PMT_Check.pm.php b/payment_methods/Check/EE_PMT_Check.pm.php index 27472908b5..2c37a2c969 100644 --- a/payment_methods/Check/EE_PMT_Check.pm.php +++ b/payment_methods/Check/EE_PMT_Check.pm.php @@ -36,7 +36,8 @@ public function __construct($pm_instance = null) * @throws ReflectionException */ public function generate_new_billing_form(EE_Transaction $transaction = null) - { return null; + { + return null; } diff --git a/payment_methods/Invoice/EE_PMT_Invoice.pm.php b/payment_methods/Invoice/EE_PMT_Invoice.pm.php index 1d3df99c31..7c711fc16f 100644 --- a/payment_methods/Invoice/EE_PMT_Invoice.pm.php +++ b/payment_methods/Invoice/EE_PMT_Invoice.pm.php @@ -50,7 +50,8 @@ public function __construct($pm_instance = null) * @throws ReflectionException */ public function generate_new_billing_form(EE_Transaction $transaction = null) - { return null; + { + return null; }
- + - + - + diff --git a/caffeinated/brewing_regular.php b/caffeinated/brewing_regular.php index 0abf67104d..a914181a3b 100644 --- a/caffeinated/brewing_regular.php +++ b/caffeinated/brewing_regular.php @@ -342,7 +342,7 @@ public function filter_taxonomies(array $taxonomy_array): array */ public function filter_cpts(array $cpt_array): array { - $cpt_array[EspressoPostType::VENUES]['args']['show_in_nav_menus'] = true; + $cpt_array[ EspressoPostType::VENUES ]['args']['show_in_nav_menus'] = true; return $cpt_array; } diff --git a/caffeinated/modules/events_archive_caff/templates/admin-event-list-settings.template.php b/caffeinated/modules/events_archive_caff/templates/admin-event-list-settings.template.php index a37415903d..544d402efa 100644 --- a/caffeinated/modules/events_archive_caff/templates/admin-event-list-settings.template.php +++ b/caffeinated/modules/events_archive_caff/templates/admin-event-list-settings.template.php @@ -291,7 +291,7 @@ ); ?>

- ✨ + ✨