1 | <?php |
||
19 | class ClientStream implements Client |
||
20 | { |
||
21 | private $options = ['headers' => []]; |
||
22 | |||
23 | public $responseHeaders = null; |
||
24 | public $requestHeaders = null; |
||
25 | |||
26 | /** |
||
27 | * Merges header string and headers array to single string with all headers |
||
28 | * @return string |
||
29 | */ |
||
30 | 8 | private function mergeHeaders() { |
|
47 | |||
48 | /** |
||
49 | * Send a HTTP request and return the response |
||
50 | * @param null $method The method to use, GET, POST, etc. |
||
|
|||
51 | * @param null $url The URL to request |
||
52 | * @param null $query The query string |
||
53 | * @param array $options Any of the HTTP stream context options, e.g. extra headers. |
||
54 | * @return string |
||
55 | */ |
||
56 | 8 | public function request( $type, $url, $request = null, $options = [] ) |
|
85 | |||
86 | /** |
||
87 | * @param array $options Any of the HTTP stream context options, e.g. extra headers. |
||
88 | */ |
||
89 | 10 | public function __construct( $options = [] ) |
|
93 | |||
94 | /** |
||
95 | * Send a GET request |
||
96 | * @param null $url The URL to request |
||
97 | * @param null $query The query string |
||
98 | * @param array $options Any of the HTTP stream context options, e.g. extra headers. |
||
99 | * @return string |
||
100 | */ |
||
101 | 7 | public function get( $url, $request = null, $options = [] ) |
|
105 | |||
106 | /** |
||
107 | * Send a POST request |
||
108 | * @param null $url The URL to request |
||
109 | * @param null $query The query string |
||
110 | * @param array $options Any of the HTTP stream context options, e.g. extra headers. |
||
111 | * @return string |
||
112 | */ |
||
113 | public function post( $url, $request = null, $options = [] ) |
||
117 | |||
118 | /** |
||
119 | * Send a PUT request |
||
120 | * @param null $url The URL to request |
||
121 | * @param null $query The query string |
||
122 | * @param array $options Any of the HTTP stream context options, e.g. extra headers. |
||
123 | * @return string |
||
124 | */ |
||
125 | public function put( $url, $request = null, $options = [] ) |
||
129 | |||
130 | /** |
||
131 | * Send a DELETE request |
||
132 | * @param string $url |
||
133 | * @param array $request |
||
134 | * @param array $options |
||
135 | * @return string |
||
136 | */ |
||
137 | public function delete( $url, $request = null, $options = [] ) |
||
141 | |||
142 | |||
143 | /** |
||
144 | * Adds headers for subsequent requests |
||
145 | * @param mixed $headers The headers to add, either as a string or an array of headers. |
||
146 | * @return $this |
||
147 | */ |
||
148 | 1 | public function headers($headers) |
|
164 | } |
||
165 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.