1 | <?php |
||
11 | class RequestBuilder |
||
12 | { |
||
13 | /** |
||
14 | * @var RequestFactory |
||
15 | */ |
||
16 | private $requestFactory; |
||
17 | |||
18 | /** |
||
19 | * @var ClientFactory |
||
20 | */ |
||
21 | private $clientFactory; |
||
22 | |||
23 | /** |
||
24 | * @var boolean |
||
25 | */ |
||
26 | private $keepCookies; |
||
27 | |||
28 | /** |
||
29 | * @var CookieJar |
||
30 | */ |
||
31 | protected $cookieJar; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | private $method; |
||
37 | |||
38 | /** |
||
39 | * @var string[] |
||
40 | */ |
||
41 | private $headers; |
||
42 | |||
43 | /** |
||
44 | * @var string[] |
||
45 | */ |
||
46 | private $queries; |
||
47 | |||
48 | /** |
||
49 | * @var string|array |
||
50 | */ |
||
51 | private $body; |
||
52 | |||
53 | /** |
||
54 | * @var array |
||
55 | */ |
||
56 | private $options; |
||
57 | |||
58 | private $postBody; |
||
59 | |||
60 | /** |
||
61 | * @var SecurityExtensionInterface[] |
||
62 | */ |
||
63 | private $securityExtensions; |
||
64 | |||
65 | /** |
||
66 | * @var Plugin[] |
||
67 | */ |
||
68 | private $plugins; |
||
69 | |||
70 | private $uri; |
||
71 | |||
72 | private $files; |
||
73 | |||
74 | private static function getAcceptedMethods() |
||
86 | |||
87 | public function __construct(ClientFactory $clientFactory) |
||
95 | |||
96 | public function build($uri = null, array $queries = null, array $headers = null, array $postBody = null, $body = null, array $options = []) |
||
146 | |||
147 | /** |
||
148 | * @param Plugin $plugin |
||
149 | * @return RequestBuilder |
||
150 | */ |
||
151 | public function addPlugin(Plugin $plugin) |
||
157 | |||
158 | /** |
||
159 | * @return Plugin[] |
||
160 | */ |
||
161 | public function getPlugins() |
||
165 | |||
166 | public function setMethod($method) |
||
182 | |||
183 | public function getMethod() |
||
187 | |||
188 | public function setHeaders(array $headers = null) |
||
194 | |||
195 | public function getHeaders() |
||
199 | |||
200 | public function setBody($body = null) |
||
206 | |||
207 | public function getQueries() |
||
211 | |||
212 | public function setQueries(array $queries = null) |
||
218 | |||
219 | public function getBody() |
||
223 | |||
224 | public function setOptions(array $options = null) |
||
230 | |||
231 | public function getOptions() |
||
235 | |||
236 | public function setPostBody(array $postBody = null) |
||
242 | |||
243 | public function getPostBody() |
||
247 | |||
248 | public function getCookies() |
||
252 | |||
253 | public function setCookies(array $cookies = null) |
||
259 | |||
260 | /** |
||
261 | * @return SecurityExtensionInterface[] |
||
262 | */ |
||
263 | public function getSecurityExtensions() |
||
267 | |||
268 | public function setUri($uri = null) |
||
274 | |||
275 | public function getUri() |
||
279 | |||
280 | public function addFile($name, $path) |
||
286 | |||
287 | /** |
||
288 | * @param boolean $keepCookies |
||
289 | * @return RequestBuilder |
||
290 | */ |
||
291 | public function keepCookies($keepCookies=true) |
||
297 | |||
298 | protected function clean() |
||
315 | |||
316 | public function addSecurityExtension(SecurityExtensionInterface $extension) |
||
323 | |||
324 | public function setSecurity(SecurityExtensionInterface $extension) |
||
329 | } |
||
330 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.