1 | <?php |
||
18 | class Request{ |
||
19 | |||
20 | /** |
||
21 | * The cURL connection |
||
22 | * |
||
23 | * @var resource |
||
24 | */ |
||
25 | protected $curl; |
||
26 | |||
27 | /** |
||
28 | * @var \chillerlan\TinyCurl\RequestOptions |
||
29 | */ |
||
30 | protected $options; |
||
31 | |||
32 | /** |
||
33 | * Request constructor. |
||
34 | * |
||
35 | * @param \chillerlan\TinyCurl\RequestOptions $options |
||
|
|||
36 | */ |
||
37 | public function __construct(RequestOptions $options = null){ |
||
40 | |||
41 | /** |
||
42 | * @param \chillerlan\TinyCurl\RequestOptions $options |
||
43 | * |
||
44 | * @return \chillerlan\TinyCurl\Request |
||
45 | */ |
||
46 | public function setOptions(RequestOptions $options):Request { |
||
51 | |||
52 | /** |
||
53 | * @param string $url |
||
54 | * |
||
55 | * @return \chillerlan\TinyCurl\Response |
||
56 | */ |
||
57 | protected function getResponse(string $url):Response { |
||
62 | |||
63 | /** |
||
64 | * @return void |
||
65 | */ |
||
66 | protected function initCurl(){ |
||
82 | |||
83 | /** |
||
84 | * @param \chillerlan\TinyCurl\URL $url |
||
85 | * @param array $curl_options |
||
86 | * |
||
87 | * @return \chillerlan\TinyCurl\Response |
||
88 | * @throws \chillerlan\TinyCurl\RequestException |
||
89 | */ |
||
90 | public function fetch(URL $url, array $curl_options = []):Response { |
||
133 | |||
134 | /** |
||
135 | * @param array $headers |
||
136 | * |
||
137 | * @return array |
||
138 | */ |
||
139 | public function normalizeHeaders(array $headers):array { |
||
163 | |||
164 | /** |
||
165 | * @param string $url |
||
166 | * |
||
167 | * @return array<string> |
||
168 | */ |
||
169 | public function extractShortUrl(string $url):array { |
||
178 | |||
179 | /** |
||
180 | * @param string $url |
||
181 | * |
||
182 | * @return string |
||
183 | * @link http://www.internoetics.com/2012/11/12/resolve-short-urls-to-their-destination-url-php-api/ |
||
184 | */ |
||
185 | protected function extract(string $url):string { |
||
209 | |||
210 | } |
||
211 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.