From ea77a43e318660998abef28dda9e46e73677c6d9 Mon Sep 17 00:00:00 2001 From: JL Date: Tue, 8 Mar 2022 15:59:53 -0800 Subject: [PATCH] fix: allowing some methods to return null (response empty) Allowing methods to return null when salesforce has an empty body with no content (deletion, for instance) --- src/Api/ReportApi.php | 12 ++++++------ src/SalesforceApi.php | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Api/ReportApi.php b/src/Api/ReportApi.php index 13b5a99..6f34a1b 100644 --- a/src/Api/ReportApi.php +++ b/src/Api/ReportApi.php @@ -95,9 +95,9 @@ public function createReport(array $reportMetadata): array * * @param string $reportId salesforce id of the report * - * @return array + * @return array|null */ - public function deleteReport(string $reportId): array + public function deleteReport(string $reportId): ?array { $request = new DeleteReport($reportId); @@ -109,9 +109,9 @@ public function deleteReport(string $reportId): array * * @param string $dashboardId salesforce id of the dashboard * - * @return array + * @return array|null */ - public function deleteDashboard(string $dashboardId): array + public function deleteDashboard(string $dashboardId): ?array { $request = new DeleteDashboard($dashboardId); @@ -681,11 +681,11 @@ public function createDashboardFolder(string $folderName): array * * @param string $folderId salesforce id of the folder * - * @return array + * @return array|null * * @link https://developer.salesforce.com/docs/atlas.en-us.api_analytics.meta/api_analytics/analytics_api_folders_create.htm */ - public function deleteFolder(string $folderId): array + public function deleteFolder(string $folderId): ?array { $request = new DeleteFolder($folderId); diff --git a/src/SalesforceApi.php b/src/SalesforceApi.php index 4623706..356f015 100644 --- a/src/SalesforceApi.php +++ b/src/SalesforceApi.php @@ -237,9 +237,9 @@ public function getLimits() * * @throws GuzzleException|SaloonException|\ReflectionException * - * @return array + * @return array|null */ - protected function executeRequest(SaloonRequest $request): array + protected function executeRequest(SaloonRequest $request): ?array { $response = $request->send()->json();