From db9e4c35227bce6bc5d5d5674867c0dda3fe0012 Mon Sep 17 00:00:00 2001 From: Dylan Munson <65001528+CodeyGuyDylan@users.noreply.github.com> Date: Thu, 8 Aug 2024 11:58:09 -0600 Subject: [PATCH] Fix some php typing --- projects/packages/my-jetpack/src/class-initializer.php | 6 +++--- .../packages/my-jetpack/src/class-rest-product-data.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/packages/my-jetpack/src/class-initializer.php b/projects/packages/my-jetpack/src/class-initializer.php index fba531c778ccc..2b96ea802e97d 100644 --- a/projects/packages/my-jetpack/src/class-initializer.php +++ b/projects/packages/my-jetpack/src/class-initializer.php @@ -630,7 +630,7 @@ public static function get_site() { return new WP_Error( 'site_data_fetch_failed', 'Site data fetch failed', array( 'status' => $response_code ) ); } - return rest_ensure_response( $body, 200 ); + return rest_ensure_response( $body ); } /** @@ -664,7 +664,7 @@ public static function get_site_info() { /** * Returns whether a site has been determined "commercial" or not. * - * @return bool + * @return bool|null */ public static function is_commercial_site() { if ( is_wp_error( self::$site_info ) ) { @@ -690,7 +690,7 @@ public static function is_registered() { */ public static function dismiss_welcome_banner() { \Jetpack_Options::update_option( 'dismissed_welcome_banner', true ); - return rest_ensure_response( array( 'success' => true ), 200 ); + return rest_ensure_response( array( 'success' => true ) ); } /** diff --git a/projects/packages/my-jetpack/src/class-rest-product-data.php b/projects/packages/my-jetpack/src/class-rest-product-data.php index d49585ca11026..15530adb28174 100644 --- a/projects/packages/my-jetpack/src/class-rest-product-data.php +++ b/projects/packages/my-jetpack/src/class-rest-product-data.php @@ -107,14 +107,14 @@ public static function get_site_backup_undo_event() { } } - return rest_ensure_response( $undo_event, 200 ); + return rest_ensure_response( $undo_event ); } /** * This will collect a count of all the items that could be backed up * This is used to show what backup could be doing if it is not enabled * - * @return array + * @return WP_Error|\WP_REST_Response */ public static function count_things_that_can_be_backed_up() { $image_mime_type = 'image'; @@ -142,6 +142,6 @@ public static function count_things_that_can_be_backed_up() { // Add all audio attachments together to get the total audio count $data['total_audio_count'] = array_sum( (array) wp_count_attachments( $audio_mime_type ) ); - return rest_ensure_response( $data, 200 ); + return rest_ensure_response( $data ); } }