Merge branch 'develop' into PCP-5180-fix-php-8-compatibility-issues-dynamic-properties-and-phpcs-configuration-phpcs

This commit is contained in:
Miguel Pérez Pellicer 2025-08-22 17:16:02 +02:00
commit 1c2d7e032a
9 changed files with 231 additions and 22 deletions

View file

@ -55,8 +55,8 @@ class Shipping {
* @param ShippingOption[] $options Shipping methods.
*/
public function __construct(
string $name = null,
Address $address = null,
?string $name = null,
?Address $address = null,
?string $email_address = null,
?Phone $phone_number = null,
array $options = array()

View file

@ -199,26 +199,6 @@ class SettingsModule implements ServiceModule, ExecutableModule {
&& update_option( SwitchSettingsUiEndpoint::OPTION_NAME_SHOULD_USE_OLD_UI, 'yes' )
);
/**
* This hook is fired when the plugin is installed or updated.
*/
add_action(
'woocommerce_paypal_payments_gateway_migrate',
function () use ( $container ) {
$path_repository = $container->get( 'settings.service.branded-experience.path-repository' );
assert( $path_repository instanceof PathRepository );
$partner_attribution = $container->get( 'api.helper.partner-attribution' );
assert( $partner_attribution instanceof PartnerAttribution );
$general_settings = $container->get( 'settings.data.general' );
assert( $general_settings instanceof GeneralSettings );
$path_repository->persist();
$partner_attribution->initialize_bn_code( $general_settings->get_installation_path() );
}
);
// Suppress WooCommerce Settings UI elements via CSS to improve the loading experience.
$loading_screen_service = $container->get( 'settings.services.loading-screen-service' );
assert( $loading_screen_service instanceof LoadingScreenService );

View file

@ -190,6 +190,62 @@ class CreditCardGateway extends \WC_Payment_Gateway_CC {
*/
protected $logger;
/**
* ID of the class extending the settings API. Used in option names.
*
* @var string
*/
public $id;
/**
* Supported features such as 'default_credit_card_form', 'refunds'.
*
* @var array
*/
public $supports = array( 'products' );
/**
* Gateway title.
*
* @var string
*/
public $method_title = '';
/**
* Gateway description.
*
* @var string
*/
public $method_description = '';
/**
* Payment method title for the frontend.
*
* @var string
*/
public $title;
/**
* Payment method description for the frontend.
*
* @var string
*/
public $description;
/**
* Form option fields.
*
* @var array
*/
public $form_fields = array();
/**
* Yes or no based on whether the method is enabled.
*
* @var string
*/
public $enabled = 'yes';
/**
* CreditCardGateway constructor.
*

View file

@ -86,6 +86,55 @@ class OXXOGateway extends WC_Payment_Gateway {
*/
protected ExperienceContextBuilder $experience_context_builder;
/**
* ID of the class extending the settings API. Used in option names.
*
* @var string
*/
public $id;
/**
* Gateway title.
*
* @var string
*/
public $method_title = '';
/**
* Gateway description.
*
* @var string
*/
public $method_description = '';
/**
* Payment method title for the frontend.
*
* @var string
*/
public $title;
/**
* Payment method description for the frontend.
*
* @var string
*/
public $description;
/**
* Form option fields.
*
* @var array
*/
public $form_fields = array();
/**
* Icon for the gateway.
*
* @var string
*/
public $icon;
/**
* OXXOGateway constructor.
*

View file

@ -217,6 +217,69 @@ class PayPalGateway extends \WC_Payment_Gateway {
*/
private $admin_settings_enabled;
/**
* ID of the class extending the settings API. Used in option names.
*
* @var string
*/
public $id;
/**
* Gateway title.
*
* @var string
*/
public $method_title = '';
/**
* Gateway description.
*
* @var string
*/
public $method_description = '';
/**
* Payment method title for the frontend.
*
* @var string
*/
public $title;
/**
* Payment method description for the frontend.
*
* @var string
*/
public $description;
/**
* Form option fields.
*
* @var array
*/
public $form_fields = array();
/**
* Icon for the gateway.
*
* @var string
*/
public $icon;
/**
* Supported features such as 'default_credit_card_form', 'refunds'.
*
* @var array
*/
public $supports = array( 'products' );
/**
* Set if the place order button should be renamed on selection.
*
* @var string
*/
public $order_button_text;
/**
* PayPalGateway constructor.
*

View file

@ -102,6 +102,62 @@ class PayUponInvoiceGateway extends WC_Payment_Gateway {
*/
private $module_url;
/**
* ID of the class extending the settings API. Used in option names.
*
* @var string
*/
public $id;
/**
* Gateway title.
*
* @var string
*/
public $method_title = '';
/**
* Gateway description.
*
* @var string
*/
public $method_description = '';
/**
* Payment method title for the frontend.
*
* @var string
*/
public $title;
/**
* Payment method description for the frontend.
*
* @var string
*/
public $description;
/**
* Form option fields.
*
* @var array
*/
public $form_fields = array();
/**
* Icon for the gateway.
*
* @var string
*/
public $icon;
/**
* Supported features such as 'default_credit_card_form', 'refunds'.
*
* @var array
*/
public $supports = array( 'products' );
/**
* PayUponInvoiceGateway constructor.
*

View file

@ -30,6 +30,7 @@ class PaymentTokenEndpointTest extends TestCase
private $customer_repository;
private $request_id_repository;
private $sut;
private $logger;
public function setUp(): void
{

View file

@ -74,6 +74,8 @@ class ModularTestCase extends TestCase
$module = new class ($overriddenServices) implements ServiceModule, ExecutableModule {
use ModuleClassNameIdTrait;
private $services;
public function __construct(array $services) {
$this->services = $services;
}

View file

@ -45,6 +45,8 @@ class AuthorizedPaymentsProcessorTest extends TestCase
private $config;
private $captureId = '123qwe';
private $testee;
private $subscription_helper;
private $amount_factory;
public function setUp(): void {
parent::setUp();