From 6848100f97630717394d69e511898a426795a08d Mon Sep 17 00:00:00 2001 From: Jorge M Date: Tue, 5 Mar 2024 18:02:50 +0100 Subject: [PATCH] Add missing return types --- src/DB/Table/MerchantIssueTable.php | 4 ++-- src/MerchantCenter/MerchantStatuses.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DB/Table/MerchantIssueTable.php b/src/DB/Table/MerchantIssueTable.php index 0fb97528e8..e93fe77161 100644 --- a/src/DB/Table/MerchantIssueTable.php +++ b/src/DB/Table/MerchantIssueTable.php @@ -56,7 +56,7 @@ public static function get_raw_name(): string { * * @param DateTime $created_before Delete all records created before this. */ - public function delete_stale( DateTime $created_before ) { + public function delete_stale( DateTime $created_before ): void { $query = "DELETE FROM `{$this->get_sql_safe_name()}` WHERE `created_at` < '%s'"; $this->wpdb->query( $this->wpdb->prepare( $query, $created_before->format( 'Y-m-d H:i:s' ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL } @@ -67,7 +67,7 @@ public function delete_stale( DateTime $created_before ) { * @param array $products_ids Array of product IDs to delete issues for. * @param string $source The source of the issues. Default is 'mc'. */ - public function delete_specific_product_issues( array $products_ids, string $source = 'mc' ) { + public function delete_specific_product_issues( array $products_ids, string $source = 'mc' ): void { $placeholder = '(' . implode( ',', array_fill( 0, count( $products_ids ), '%d' ) ) . ')'; $this->wpdb->query( $this->wpdb->prepare( "DELETE FROM `{$this->get_sql_safe_name()}` WHERE `product_id` IN {$placeholder} AND `source` = %s", array_merge( $products_ids, [ $source ] ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL } diff --git a/src/MerchantCenter/MerchantStatuses.php b/src/MerchantCenter/MerchantStatuses.php index 5605736e04..570c071588 100644 --- a/src/MerchantCenter/MerchantStatuses.php +++ b/src/MerchantCenter/MerchantStatuses.php @@ -200,7 +200,7 @@ protected function delete_product_statuses_count_intermediate_data(): void { * * @since x.x.x */ - protected function delete_stale_issues() { + protected function delete_stale_issues(): void { $this->container->get( MerchantIssueTable::class )->delete_stale( $this->cache_created_time ); }