Skip to content

Commit a4a1907

Browse files
committed
fix: remove return type declarations from Base_Gateway abstract methods
External gateway plugins that extend Base_Gateway without matching return type declarations cause a PHP fatal error. Removing return types from the abstract base class restores compatibility with third-party gateways while keeping the concrete implementations (Stripe, PayPal) typed.
1 parent 4ad3bbd commit a4a1907

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

inc/gateways/class-base-gateway.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public function __construct($order = null) {
165165
* @param \WP_Ultimo\Checkout\Cart $order The order.
166166
* @return void
167167
*/
168-
public function set_order($order): void {
168+
public function set_order($order) {
169169

170170
if (null === $order) {
171171
return;
@@ -608,7 +608,7 @@ public function verify_and_complete_payment(int $payment_id): array {
608608
* @param string $gateway_payment_id The gateway payment id.
609609
* @return string
610610
*/
611-
public function get_payment_url_on_gateway($gateway_payment_id): string {
611+
public function get_payment_url_on_gateway($gateway_payment_id) {
612612
unset($gateway_payment_id);
613613
return '';
614614
}
@@ -623,7 +623,7 @@ public function get_payment_url_on_gateway($gateway_payment_id): string {
623623
* @param string $gateway_subscription_id The gateway subscription id.
624624
* @return string
625625
*/
626-
public function get_subscription_url_on_gateway($gateway_subscription_id): string {
626+
public function get_subscription_url_on_gateway($gateway_subscription_id) {
627627
unset($gateway_subscription_id);
628628
return '';
629629
}
@@ -638,7 +638,7 @@ public function get_subscription_url_on_gateway($gateway_subscription_id): strin
638638
* @param string $gateway_customer_id The gateway customer id.
639639
* @return string
640640
*/
641-
public function get_customer_url_on_gateway($gateway_customer_id): string {
641+
public function get_customer_url_on_gateway($gateway_customer_id) {
642642
unset($gateway_customer_id);
643643
return '';
644644
}
@@ -853,7 +853,7 @@ public function get_webhook_listener_url() {
853853
* @param \WP_Ultimo\Models\Payment $payment The payment.
854854
* @return void
855855
*/
856-
public function set_payment($payment): void {
856+
public function set_payment($payment) {
857857

858858
$this->payment = $payment;
859859
}
@@ -865,7 +865,7 @@ public function set_payment($payment): void {
865865
* @param \WP_Ultimo\Models\Membership $membership The membership.
866866
* @return void
867867
*/
868-
public function set_membership($membership): void {
868+
public function set_membership($membership) {
869869

870870
$this->membership = $membership;
871871
}
@@ -877,7 +877,7 @@ public function set_membership($membership): void {
877877
* @param \WP_Ultimo\Models\Customer $customer The customer.
878878
* @return void
879879
*/
880-
public function set_customer($customer): void {
880+
public function set_customer($customer) {
881881

882882
$this->customer = $customer;
883883
}
@@ -891,7 +891,7 @@ public function set_customer($customer): void {
891891
* @param \WP_Ultimo\Models\Membership $membership The membership object.
892892
* @return void
893893
*/
894-
public function trigger_payment_processed($payment, $membership = null): void {
894+
public function trigger_payment_processed($payment, $membership = null) {
895895

896896
if (null === $membership) {
897897
$membership = $payment->get_membership();

0 commit comments

Comments
 (0)