Automattic / woocommerce-subscriptions-core

Subscriptions core package for WooCommerce
Other
80 stars 29 forks source link

Fix PHP 8.2 deprecated dynamic property errors in \WCS_PayPal_Reference_Transaction_API #573

Closed lipemat closed 3 months ago

lipemat commented 4 months ago

PHP 8.2 required properties be defined before assigning them. The \WCS_PayPal_Reference_Transaction_API class has 4 properties assigned in __constructs which do not exist and return deprecated warnings.

Description

Support using PHP 8.2 with the \WCS_PayPal_Reference_Transaction_API class without filling the logs with deprecated warnings or throwing exceptions during testing.

How to test this PR

  1. Set error_reporting = E_ALL in php.ini and tail the logs.
  2. Use convertDeprecationsToExceptions="true" in config during unit testing.
  3. Call any code which constructs the \WCS_PayPal_Reference_Transaction_API class.

Product impact