Skip to content

["BUG"] Creation of dynamic property #106

@MaferMazu

Description

@MaferMazu

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.

Metadata

Metadata

Assignees

Labels

bugReport of or fix for something that isn't working as intendedhelp wantedReady to be picked up by anyone in the community

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions