From abeb4cfe1d6f7445569800f1c3b919525761a67d Mon Sep 17 00:00:00 2001 From: root Date: Tue, 20 Oct 2020 18:34:13 +0800 Subject: [PATCH 1/2] Fix postJson parameter type error --- src/Utility/NewWork.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Utility/NewWork.php b/src/Utility/NewWork.php index 74add42..8718400 100644 --- a/src/Utility/NewWork.php +++ b/src/Utility/NewWork.php @@ -38,7 +38,7 @@ public static function post($endpoint, $data, $options = []) return $client->setTimeout(self::$TIMEOUT)->post($data); } - public static function postJson(string $endpoint, array $data, $options = []) + public static function postJson(string $endpoint, string $data, $options = []) { $client = new HttpClient($endpoint); $client->setTimeout(self::$TIMEOUT); From 9f1988ed380f2a241a7252799ec22432ffbd8b8c Mon Sep 17 00:00:00 2001 From: root Date: Tue, 20 Oct 2020 18:44:58 +0800 Subject: [PATCH 2/2] for postXML , increase the appropriate parameter type --- src/Utility/NewWork.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Utility/NewWork.php b/src/Utility/NewWork.php index 8718400..ebe0f97 100644 --- a/src/Utility/NewWork.php +++ b/src/Utility/NewWork.php @@ -50,7 +50,7 @@ public static function postJson(string $endpoint, string $data, $options = []) return $client->postJson($data); } - public static function postXML($endpoint, $data, $options = []) + public static function postXML(string $endpoint, string $data, $options = []) { $client = new HttpClient($endpoint); $client->setTimeout(self::$TIMEOUT);