From 7f64906a2d650e4af1d6f95a6ba444ff62404ec4 Mon Sep 17 00:00:00 2001 From: Glauber Silva Date: Fri, 20 Sep 2024 17:45:11 -0300 Subject: [PATCH] refactor: remove RestResponses trait --- src/Campaigns/Routes/Traits/RestResponses.php | 51 ------------------- 1 file changed, 51 deletions(-) delete mode 100644 src/Campaigns/Routes/Traits/RestResponses.php diff --git a/src/Campaigns/Routes/Traits/RestResponses.php b/src/Campaigns/Routes/Traits/RestResponses.php deleted file mode 100644 index 52aa39fd10..0000000000 --- a/src/Campaigns/Routes/Traits/RestResponses.php +++ /dev/null @@ -1,51 +0,0 @@ - 404, - 'response' => $response, - 'body_response' => [ - 'message' => html_entity_decode( - $message - ), - ], - ] - ); - } - - /** - * @unreleased - */ - public function badRequestResponse(Exception $e, $response = 'rest_bad_request'): WP_REST_Response - { - return new WP_REST_Response( - [ - 'status' => 400, - 'response' => $response, - 'body_response' => [ - 'message' => html_entity_decode( - sprintf( - esc_html__('%s. Search the logs at Donations > Tools > Logs for a more specific cause of the problem.', - 'give'), rtrim($e->getMessage(), '.') - ) - ), - ], - ] - ); - } -}