Describe the bug
We are adding a property not defined in the class in the first place. In PHP, they call it a dynamic property.
Since PHP 8.2 generates a deprecation warning. For PHP 9, that could cause a fatal error.
[09-Dec-2024 21:40:55 UTC] PHP Deprecated: Creation of dynamic property OpenedX_Commerce\model\Openedx_Commerce_Enrollment::$parent is deprecated in /var/www/html/wp-content/plugins/openedx-commerce/includes/model/class-openedx-commerce-enrollment.php on line 58
Deprecated: Creation of dynamic property OpenedX_Commerce\model\Openedx_Commerce_Enrollment::$parent is deprecated in /var/www/html/wp-content/plugins/openedx-commerce/includes/model/class-openedx-commerce-enrollment.php on line 58
To Reproduce
I found that warning in the Plugin check workflow.
Example: https://github.com/openedx/openedx-wordpress-ecommerce/actions/runs/12168160490/job/34157245826?pr=104
Expected behavior
Don't have dynamic properties.
Describe the bug
We are adding a property not defined in the class in the first place. In PHP, they call it a dynamic property.
Since PHP 8.2 generates a deprecation warning. For PHP 9, that could cause a fatal error.
To Reproduce
I found that warning in the Plugin check workflow.
Example: https://github.com/openedx/openedx-wordpress-ecommerce/actions/runs/12168160490/job/34157245826?pr=104
Expected behavior
Don't have dynamic properties.