Skip to content

Commit 5ea9761

Browse files
committed
Merge pull request #7 from php-http/refine-phpdoc
Refine PHPDoc
2 parents ff83847 + f3cef46 commit 5ea9761

File tree

2 files changed

+48
-36
lines changed

2 files changed

+48
-36
lines changed

src/HttpAdapter.php

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Http\Adapter;
1313

14+
use Psr\Http\Message\StreamInterface;
1415
use Psr\Http\Message\UriInterface;
1516
use Psr\Http\Message\ResponseInterface;
1617

@@ -25,7 +26,8 @@ interface HttpAdapter extends PsrHttpAdapter
2526
* @param string|UriInterface $uri
2627
* @param string[] $headers
2728
*
28-
* @throws HttpAdapterException If an error occurred.
29+
* @throws \InvalidArgumentException
30+
* @throws HttpAdapterException
2931
*
3032
* @return ResponseInterface
3133
*/
@@ -37,7 +39,8 @@ public function get($uri, array $headers = []);
3739
* @param string|UriInterface $uri
3840
* @param string[] $headers
3941
*
40-
* @throws HttpAdapterException If an error occurred.
42+
* @throws \InvalidArgumentException
43+
* @throws HttpAdapterException
4144
*
4245
* @return ResponseInterface
4346
*/
@@ -49,7 +52,8 @@ public function head($uri, array $headers = []);
4952
* @param string|UriInterface $uri
5053
* @param string[] $headers
5154
*
52-
* @throws HttpAdapterException If an error occurred.
55+
* @throws \InvalidArgumentException
56+
* @throws HttpAdapterException
5357
*
5458
* @return ResponseInterface
5559
*/
@@ -58,12 +62,13 @@ public function trace($uri, array $headers = []);
5862
/**
5963
* Sends a POST request
6064
*
61-
* @param string|UriInterface $uri
62-
* @param string[] $headers
63-
* @param array|string $data
64-
* @param array $files
65+
* @param string|UriInterface $uri
66+
* @param string[] $headers
67+
* @param array|string|StreamInterface $data
68+
* @param array $files
6569
*
66-
* @throws HttpAdapterException If an error occurred.
70+
* @throws \InvalidArgumentException
71+
* @throws HttpAdapterException
6772
*
6873
* @return ResponseInterface
6974
*/
@@ -72,12 +77,13 @@ public function post($uri, array $headers = [], $data = [], array $files = []);
7277
/**
7378
* Sends a PUT request
7479
*
75-
* @param string|UriInterface $uri
76-
* @param string[] $headers
77-
* @param array|string $data
78-
* @param array $files
80+
* @param string|UriInterface $uri
81+
* @param string[] $headers
82+
* @param array|string|StreamInterface $data
83+
* @param array $files
7984
*
80-
* @throws HttpAdapterException If an error occurred.
85+
* @throws \InvalidArgumentException
86+
* @throws HttpAdapterException
8187
*
8288
* @return ResponseInterface
8389
*/
@@ -86,12 +92,13 @@ public function put($uri, array $headers = [], $data = [], array $files = []);
8692
/**
8793
* Sends a PATCH request
8894
*
89-
* @param string|UriInterface $uri
90-
* @param string[] $headers
91-
* @param array|string $data
92-
* @param array $files
95+
* @param string|UriInterface $uri
96+
* @param string[] $headers
97+
* @param array|string|StreamInterface $data
98+
* @param array $files
9399
*
94-
* @throws HttpAdapterException If an error occurred.
100+
* @throws \InvalidArgumentException
101+
* @throws HttpAdapterException
95102
*
96103
* @return ResponseInterface
97104
*/
@@ -100,12 +107,13 @@ public function patch($uri, array $headers = [], $data = [], array $files = []);
100107
/**
101108
* Sends a DELETE request
102109
*
103-
* @param string|UriInterface $uri
104-
* @param string[] $headers
105-
* @param array|string $data
106-
* @param array $files
110+
* @param string|UriInterface $uri
111+
* @param string[] $headers
112+
* @param array|string|StreamInterface $data
113+
* @param array $files
107114
*
108-
* @throws HttpAdapterException If an error occurred.
115+
* @throws \InvalidArgumentException
116+
* @throws HttpAdapterException
109117
*
110118
* @return ResponseInterface
111119
*/
@@ -114,12 +122,13 @@ public function delete($uri, array $headers = [], $data = [], array $files = [])
114122
/**
115123
* Sends an OPTIONS request
116124
*
117-
* @param string|UriInterface $uri
118-
* @param string[] $headers
119-
* @param array|string $data
120-
* @param array $files
125+
* @param string|UriInterface $uri
126+
* @param string[] $headers
127+
* @param array|string|StreamInterface $data
128+
* @param array $files
121129
*
122-
* @throws HttpAdapterException If an error occurred.
130+
* @throws \InvalidArgumentException
131+
* @throws HttpAdapterException
123132
*
124133
* @return ResponseInterface
125134
*/
@@ -128,13 +137,14 @@ public function options($uri, array $headers = [], $data = [], array $files = []
128137
/**
129138
* Sends a request
130139
*
131-
* @param string $method
132-
* @param string|UriInterface $uri
133-
* @param string[] $headers
134-
* @param array|string $data
135-
* @param array $files
140+
* @param string $method
141+
* @param string|UriInterface $uri
142+
* @param string[] $headers
143+
* @param array|string|StreamInterface $data
144+
* @param array $files
136145
*
137-
* @throws HttpAdapterException If an error occurred.
146+
* @throws \InvalidArgumentException
147+
* @throws HttpAdapterException
138148
*
139149
* @return ResponseInterface
140150
*/

src/PsrHttpAdapter.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ interface PsrHttpAdapter
2626
*
2727
* @return ResponseInterface
2828
*
29-
* @throws HttpAdapterException If an error occurred.
29+
* @throws \InvalidArgumentException
30+
* @throws HttpAdapterException
3031
*/
3132
public function sendRequest(RequestInterface $request);
3233

@@ -37,7 +38,8 @@ public function sendRequest(RequestInterface $request);
3738
*
3839
* @return ResponseInterface[]
3940
*
40-
* @throws MultiHttpAdapterException If an error occurred.
41+
* @throws \InvalidArgumentException
42+
* @throws MultiHttpAdapterException
4143
*/
4244
public function sendRequests(array $requests);
4345

0 commit comments

Comments
 (0)