From 843337d248175ddf262684a8638215b240c6c877 Mon Sep 17 00:00:00 2001 From: Sebastian Volland Date: Tue, 20 Dec 2022 12:02:17 +0100 Subject: [PATCH] Fix docblock type annotations for `$meta_value` parameter. (#33853) Fix docblock type annotations for `meta_value` parameter. --- plugins/woocommerce/changelog/fix-docblock-type-annotation | 4 ++++ plugins/woocommerce/includes/class-wc-post-data.php | 2 +- .../includes/data-stores/class-wc-order-item-data-store.php | 2 +- .../interfaces/class-wc-order-item-data-store-interface.php | 2 +- plugins/woocommerce/includes/wc-deprecated-functions.php | 2 +- plugins/woocommerce/includes/wc-order-item-functions.php | 6 +++--- plugins/woocommerce/includes/wc-user-functions.php | 2 +- 7 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 plugins/woocommerce/changelog/fix-docblock-type-annotation diff --git a/plugins/woocommerce/changelog/fix-docblock-type-annotation b/plugins/woocommerce/changelog/fix-docblock-type-annotation new file mode 100644 index 00000000000..d696a34b2cd --- /dev/null +++ b/plugins/woocommerce/changelog/fix-docblock-type-annotation @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Fix docblock type annotations for $meta_value. diff --git a/plugins/woocommerce/includes/class-wc-post-data.php b/plugins/woocommerce/includes/class-wc-post-data.php index 084045722a6..b27cfe47db8 100644 --- a/plugins/woocommerce/includes/class-wc-post-data.php +++ b/plugins/woocommerce/includes/class-wc-post-data.php @@ -502,7 +502,7 @@ class WC_Post_Data { * @param int $meta_id Meta ID. * @param int $object_id Object ID. * @param string $meta_key Meta key. - * @param string $meta_value Meta value. + * @param mixed $meta_value Meta value. */ public static function flush_object_meta_cache( $meta_id, $object_id, $meta_key, $meta_value ) { WC_Cache_Helper::invalidate_cache_group( 'object_' . $object_id ); diff --git a/plugins/woocommerce/includes/data-stores/class-wc-order-item-data-store.php b/plugins/woocommerce/includes/data-stores/class-wc-order-item-data-store.php index 46600ac21c0..0f41e9ad347 100644 --- a/plugins/woocommerce/includes/data-stores/class-wc-order-item-data-store.php +++ b/plugins/woocommerce/includes/data-stores/class-wc-order-item-data-store.php @@ -113,7 +113,7 @@ class WC_Order_Item_Data_Store implements WC_Order_Item_Data_Store_Interface { * @since 3.0.0 * @param int $item_id Item ID. * @param string $meta_key Meta key. - * @param string $meta_value (default: ''). + * @param mixed $meta_value (default: ''). * @param bool $delete_all (default: false). * @return bool */ diff --git a/plugins/woocommerce/includes/interfaces/class-wc-order-item-data-store-interface.php b/plugins/woocommerce/includes/interfaces/class-wc-order-item-data-store-interface.php index b23f42727bd..80493094a1c 100644 --- a/plugins/woocommerce/includes/interfaces/class-wc-order-item-data-store-interface.php +++ b/plugins/woocommerce/includes/interfaces/class-wc-order-item-data-store-interface.php @@ -68,7 +68,7 @@ interface WC_Order_Item_Data_Store_Interface { * * @param int $item_id Item ID. * @param string $meta_key Meta key. - * @param string $meta_value Meta value (default: ''). + * @param mixed $meta_value Meta value (default: ''). * @param bool $delete_all Delete all matching entries? (default: false). * @return bool */ diff --git a/plugins/woocommerce/includes/wc-deprecated-functions.php b/plugins/woocommerce/includes/wc-deprecated-functions.php index 71c00b38513..18c83d878da 100644 --- a/plugins/woocommerce/includes/wc-deprecated-functions.php +++ b/plugins/woocommerce/includes/wc-deprecated-functions.php @@ -1098,7 +1098,7 @@ function add_woocommerce_term_meta( $term_id, $meta_key, $meta_value, $unique = * @deprecated 3.6.0 * @param int $term_id Term ID. * @param string $meta_key Meta key. - * @param string $meta_value Meta value (default: ''). + * @param mixed $meta_value Meta value (default: ''). * @param bool $deprecated Deprecated param (default: false). * @return bool */ diff --git a/plugins/woocommerce/includes/wc-order-item-functions.php b/plugins/woocommerce/includes/wc-order-item-functions.php index 5f7c6a1f942..7c6fcee4a7e 100644 --- a/plugins/woocommerce/includes/wc-order-item-functions.php +++ b/plugins/woocommerce/includes/wc-order-item-functions.php @@ -95,7 +95,7 @@ function wc_delete_order_item( $item_id ) { * * @param int $item_id Item ID. * @param string $meta_key Meta key. - * @param string $meta_value Meta value. + * @param mixed $meta_value Meta value. * @param string $prev_value Previous value (default: ''). * * @throws Exception When `WC_Data_Store::load` validation fails. @@ -115,7 +115,7 @@ function wc_update_order_item_meta( $item_id, $meta_key, $meta_value, $prev_valu * * @param int $item_id Item ID. * @param string $meta_key Meta key. - * @param string $meta_value Meta value. + * @param mixed $meta_value Meta value. * @param bool $unique If meta data should be unique (default: false). * * @throws Exception When `WC_Data_Store::load` validation fails. @@ -137,7 +137,7 @@ function wc_add_order_item_meta( $item_id, $meta_key, $meta_value, $unique = fal * * @param int $item_id Item ID. * @param string $meta_key Meta key. - * @param string $meta_value Meta value (default: ''). + * @param mixed $meta_value Meta value (default: ''). * @param bool $delete_all Delete all meta data, defaults to `false`. * * @throws Exception When `WC_Data_Store::load` validation fails. diff --git a/plugins/woocommerce/includes/wc-user-functions.php b/plugins/woocommerce/includes/wc-user-functions.php index 8204fa2394c..6b98a8a8df0 100644 --- a/plugins/woocommerce/includes/wc-user-functions.php +++ b/plugins/woocommerce/includes/wc-user-functions.php @@ -779,7 +779,7 @@ add_action( 'profile_update', 'wc_update_profile_last_update_time', 10, 2 ); * @param int $meta_id ID of the meta object that was changed. * @param int $user_id The user that was updated. * @param string $meta_key Name of the meta key that was changed. - * @param string $_meta_value Value of the meta that was changed. + * @param mixed $_meta_value Value of the meta that was changed. */ function wc_meta_update_last_update_time( $meta_id, $user_id, $meta_key, $_meta_value ) { $keys_to_track = apply_filters( 'woocommerce_user_last_update_fields', array( 'first_name', 'last_name' ) );