Automattic / woocommerce-subscriptions-core

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

PHP 8.2 Warnings from WCS_Array_Property_Post_Meta_Black_Magic #515

Closed mikejolley closed 8 months ago

mikejolley commented 9 months ago

Describe the bug

With debug mode on a user reports that PHP depreciation notices were logged when using 8.2. They were using Subscriptions 5.5 (I will instruct them to update) but the file in question has not been updated recently.

To Reproduce

Expected behavior

No notices should be logged.

Actual behavior

Deprecated: Return type of WCS_Array_Property_Post_Meta_Black_Magic::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/tmark/Local Sites/ssgc-local/app/public/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/legacy/class-wcs-array-property-post-meta-black-magic.php on line 65

Deprecated: Return type of WCS_Array_Property_Post_Meta_Black_Magic::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/tmark/Local Sites/ssgc-local/app/public/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/legacy/class-wcs-array-property-post-meta-black-magic.php on line 47

Deprecated: Return type of WCS_Array_Property_Post_Meta_Black_Magic::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/tmark/Local Sites/ssgc-local/app/public/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/legacy/class-wcs-array-property-post-meta-black-magic.php on line 56

Deprecated: Return type of WCS_Array_Property_Post_Meta_Black_Magic::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/tmark/Local Sites/ssgc-local/app/public/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/legacy/class-wcs-array-property-post-meta-black-magic.php on line 72

Product impact

Additional context

7083561-zd-a8c

mattallan commented 8 months ago

Fixed with https://github.com/Automattic/woocommerce-subscriptions-core/pull/503