From 0894ff85fb3dd0443bbdb97de66eefd6256a1232 Mon Sep 17 00:00:00 2001 From: Masoud Tajer Date: Mon, 15 Apr 2024 11:02:43 +0330 Subject: [PATCH 1/4] feat: add docblock on http methods --- src/Illuminate/Http/Client/PendingRequest.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Http/Client/PendingRequest.php b/src/Illuminate/Http/Client/PendingRequest.php index 457731401051..e2257ee02615 100644 --- a/src/Illuminate/Http/Client/PendingRequest.php +++ b/src/Illuminate/Http/Client/PendingRequest.php @@ -764,6 +764,8 @@ public function dd() * @param string $url * @param array|string|null $query * @return \Illuminate\Http\Client\Response + * + * @throws ConnectionException|\Throwable */ public function get(string $url, $query = null) { @@ -778,6 +780,8 @@ public function get(string $url, $query = null) * @param string $url * @param array|string|null $query * @return \Illuminate\Http\Client\Response + * + * @throws ConnectionException|\Throwable */ public function head(string $url, $query = null) { @@ -792,6 +796,8 @@ public function head(string $url, $query = null) * @param string $url * @param array $data * @return \Illuminate\Http\Client\Response + * + * @throws ConnectionException|\Throwable */ public function post(string $url, $data = []) { @@ -806,6 +812,8 @@ public function post(string $url, $data = []) * @param string $url * @param array $data * @return \Illuminate\Http\Client\Response + * + * @throws ConnectionException|\Throwable */ public function patch(string $url, $data = []) { @@ -820,6 +828,8 @@ public function patch(string $url, $data = []) * @param string $url * @param array $data * @return \Illuminate\Http\Client\Response + * + * @throws ConnectionException|\Throwable */ public function put(string $url, $data = []) { @@ -834,6 +844,8 @@ public function put(string $url, $data = []) * @param string $url * @param array $data * @return \Illuminate\Http\Client\Response + * + * @throws ConnectionException|\Throwable */ public function delete(string $url, $data = []) { @@ -869,7 +881,7 @@ public function pool(callable $callback) * @param array $options * @return \Illuminate\Http\Client\Response * - * @throws \Exception + * @throws ConnectionException|\Exception|\Throwable */ public function send(string $method, string $url, array $options = []) { From a6fee601cc23fa91bff121cc10c083fe828cbf8e Mon Sep 17 00:00:00 2001 From: Masoud Tajer Date: Mon, 15 Apr 2024 12:30:22 +0330 Subject: [PATCH 2/4] feat: use only ConnectionException --- src/Illuminate/Http/Client/PendingRequest.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Illuminate/Http/Client/PendingRequest.php b/src/Illuminate/Http/Client/PendingRequest.php index e2257ee02615..354fdc4243bf 100644 --- a/src/Illuminate/Http/Client/PendingRequest.php +++ b/src/Illuminate/Http/Client/PendingRequest.php @@ -765,7 +765,7 @@ public function dd() * @param array|string|null $query * @return \Illuminate\Http\Client\Response * - * @throws ConnectionException|\Throwable + * @throws ConnectionException */ public function get(string $url, $query = null) { @@ -781,7 +781,7 @@ public function get(string $url, $query = null) * @param array|string|null $query * @return \Illuminate\Http\Client\Response * - * @throws ConnectionException|\Throwable + * @throws ConnectionException */ public function head(string $url, $query = null) { @@ -797,7 +797,7 @@ public function head(string $url, $query = null) * @param array $data * @return \Illuminate\Http\Client\Response * - * @throws ConnectionException|\Throwable + * @throws ConnectionException */ public function post(string $url, $data = []) { @@ -813,7 +813,7 @@ public function post(string $url, $data = []) * @param array $data * @return \Illuminate\Http\Client\Response * - * @throws ConnectionException|\Throwable + * @throws ConnectionException */ public function patch(string $url, $data = []) { @@ -829,7 +829,7 @@ public function patch(string $url, $data = []) * @param array $data * @return \Illuminate\Http\Client\Response * - * @throws ConnectionException|\Throwable + * @throws ConnectionException */ public function put(string $url, $data = []) { @@ -845,7 +845,7 @@ public function put(string $url, $data = []) * @param array $data * @return \Illuminate\Http\Client\Response * - * @throws ConnectionException|\Throwable + * @throws ConnectionException */ public function delete(string $url, $data = []) { @@ -881,7 +881,8 @@ public function pool(callable $callback) * @param array $options * @return \Illuminate\Http\Client\Response * - * @throws ConnectionException|\Exception|\Throwable + * @throws Exception + * @throws ConnectionException */ public function send(string $method, string $url, array $options = []) { @@ -1100,7 +1101,7 @@ protected function handlePromiseResponse(Response|ConnectionException|TransferEx * @param array $options * @return \Psr\Http\Message\MessageInterface|\GuzzleHttp\Promise\PromiseInterface * - * @throws \Exception + * @throws Exception */ protected function sendRequest(string $method, string $url, array $options = []) { From fef96c37ac350b31c1abc7c4357d7706df97e58d Mon Sep 17 00:00:00 2001 From: Masoud Tajer Date: Mon, 15 Apr 2024 14:12:17 +0330 Subject: [PATCH 3/4] feat: use FQN --- src/Illuminate/Http/Client/PendingRequest.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Illuminate/Http/Client/PendingRequest.php b/src/Illuminate/Http/Client/PendingRequest.php index 354fdc4243bf..73d488ba9462 100644 --- a/src/Illuminate/Http/Client/PendingRequest.php +++ b/src/Illuminate/Http/Client/PendingRequest.php @@ -765,7 +765,7 @@ public function dd() * @param array|string|null $query * @return \Illuminate\Http\Client\Response * - * @throws ConnectionException + * @throws \Illuminate\Http\Client\ConnectionException */ public function get(string $url, $query = null) { @@ -781,7 +781,7 @@ public function get(string $url, $query = null) * @param array|string|null $query * @return \Illuminate\Http\Client\Response * - * @throws ConnectionException + * @throws \Illuminate\Http\Client\ConnectionException */ public function head(string $url, $query = null) { @@ -797,7 +797,7 @@ public function head(string $url, $query = null) * @param array $data * @return \Illuminate\Http\Client\Response * - * @throws ConnectionException + * @throws \Illuminate\Http\Client\ConnectionException */ public function post(string $url, $data = []) { @@ -813,7 +813,7 @@ public function post(string $url, $data = []) * @param array $data * @return \Illuminate\Http\Client\Response * - * @throws ConnectionException + * @throws \Illuminate\Http\Client\ConnectionException */ public function patch(string $url, $data = []) { @@ -829,7 +829,7 @@ public function patch(string $url, $data = []) * @param array $data * @return \Illuminate\Http\Client\Response * - * @throws ConnectionException + * @throws \Illuminate\Http\Client\ConnectionException */ public function put(string $url, $data = []) { @@ -845,7 +845,7 @@ public function put(string $url, $data = []) * @param array $data * @return \Illuminate\Http\Client\Response * - * @throws ConnectionException + * @throws \Illuminate\Http\Client\ConnectionException */ public function delete(string $url, $data = []) { @@ -881,8 +881,8 @@ public function pool(callable $callback) * @param array $options * @return \Illuminate\Http\Client\Response * - * @throws Exception - * @throws ConnectionException + * @throws \Exception + * @throws \Illuminate\Http\Client\ConnectionException */ public function send(string $method, string $url, array $options = []) { From 685d8641d313962ce172bef45f017aa24f158715 Mon Sep 17 00:00:00 2001 From: Masoud Tajer Date: Mon, 15 Apr 2024 14:12:57 +0330 Subject: [PATCH 4/4] feat: use FQN --- src/Illuminate/Http/Client/PendingRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Http/Client/PendingRequest.php b/src/Illuminate/Http/Client/PendingRequest.php index 73d488ba9462..817a76311b5a 100644 --- a/src/Illuminate/Http/Client/PendingRequest.php +++ b/src/Illuminate/Http/Client/PendingRequest.php @@ -1101,7 +1101,7 @@ protected function handlePromiseResponse(Response|ConnectionException|TransferEx * @param array $options * @return \Psr\Http\Message\MessageInterface|\GuzzleHttp\Promise\PromiseInterface * - * @throws Exception + * @throws \Exception */ protected function sendRequest(string $method, string $url, array $options = []) {