CyberSource / cybersource-rest-client-php

PHP client library for the CyberSource REST API
27 stars 65 forks source link

Fixable compatibility issues with PHP 8.2-8.3 #153

Open unfulvio-godaddy opened 5 months ago

unfulvio-godaddy commented 5 months ago

Hi,

I'm using v0.0.47 of the SDK but the following seems to be an issue also on the latest version. Some classes seem to assign properties dynamically without declaring them. This has been deprecated in PHP 8.2 (resulting in thrown deprecation notices) and will result in fatal errors in future versions.

https://www.php.net/manual/en/language.oop5.properties.php#language.oop5.properties.dynamic-properties

Here's a partial list of notices I've seen:

there might be more

A quick workaround for this could be to add a #[AllowDynamicProperties] attribute at the start of the affected classes until a more robust handling is in place.

https://www.php.net/manual/en/class.allowdynamicproperties.php