1 | <?php |
||
33 | class FauxRequest extends WebRequest { |
||
34 | private $wasPosted = false; |
||
35 | private $requestUrl; |
||
36 | protected $cookies = []; |
||
37 | |||
38 | /** |
||
39 | * @param array $data Array of *non*-urlencoded key => value pairs, the |
||
40 | * fake GET/POST values |
||
41 | * @param bool $wasPosted Whether to treat the data as POST |
||
42 | * @param MediaWiki\Session\Session|array|null $session Session, session |
||
43 | * data array, or null |
||
44 | * @param string $protocol 'http' or 'https' |
||
45 | * @throws MWException |
||
46 | */ |
||
47 | public function __construct( $data = [], $wasPosted = false, |
||
71 | |||
72 | /** |
||
73 | * Initialise the header list |
||
74 | */ |
||
75 | protected function initHeaders() { |
||
78 | |||
79 | /** |
||
80 | * @param string $name |
||
81 | * @param string $default |
||
82 | * @return string |
||
83 | */ |
||
84 | public function getText( $name, $default = '' ) { |
||
88 | |||
89 | /** |
||
90 | * @return array |
||
91 | */ |
||
92 | public function getValues() { |
||
95 | |||
96 | /** |
||
97 | * @return array |
||
98 | */ |
||
99 | public function getQueryValues() { |
||
106 | |||
107 | public function getMethod() { |
||
110 | |||
111 | /** |
||
112 | * @return bool |
||
113 | */ |
||
114 | public function wasPosted() { |
||
117 | |||
118 | public function getCookie( $key, $prefix = null, $default = null ) { |
||
126 | |||
127 | /** |
||
128 | * @since 1.26 |
||
129 | * @param string $name Unprefixed name of the cookie to set |
||
|
|||
130 | * @param string|null $value Value of the cookie to set |
||
131 | * @param string|null $prefix Cookie prefix. Defaults to $wgCookiePrefix |
||
132 | */ |
||
133 | public function setCookie( $key, $value, $prefix = null ) { |
||
136 | |||
137 | /** |
||
138 | * @since 1.26 |
||
139 | * @param array $cookies |
||
140 | * @param string|null $prefix Cookie prefix. Defaults to $wgCookiePrefix |
||
141 | */ |
||
142 | public function setCookies( $cookies, $prefix = null ) { |
||
152 | |||
153 | /** |
||
154 | * @since 1.25 |
||
155 | */ |
||
156 | public function setRequestURL( $url ) { |
||
159 | |||
160 | /** |
||
161 | * @since 1.25 MWException( "getRequestURL not implemented" ) |
||
162 | * no longer thrown. |
||
163 | */ |
||
164 | public function getRequestURL() { |
||
170 | |||
171 | public function getProtocol() { |
||
174 | |||
175 | /** |
||
176 | * @param string $name |
||
177 | * @param string $val |
||
178 | */ |
||
179 | public function setHeader( $name, $val ) { |
||
182 | |||
183 | /** |
||
184 | * @since 1.26 |
||
185 | * @param array $headers |
||
186 | */ |
||
187 | public function setHeaders( $headers ) { |
||
193 | |||
194 | /** |
||
195 | * @return array|null |
||
196 | */ |
||
197 | public function getSessionArray() { |
||
203 | |||
204 | /** |
||
205 | * FauxRequests shouldn't depend on raw request data (but that could be implemented here) |
||
206 | * @return string |
||
207 | */ |
||
208 | public function getRawQueryString() { |
||
211 | |||
212 | /** |
||
213 | * FauxRequests shouldn't depend on raw request data (but that could be implemented here) |
||
214 | * @return string |
||
215 | */ |
||
216 | public function getRawPostString() { |
||
219 | |||
220 | /** |
||
221 | * FauxRequests shouldn't depend on raw request data (but that could be implemented here) |
||
222 | * @return string |
||
223 | */ |
||
224 | public function getRawInput() { |
||
227 | |||
228 | /** |
||
229 | * @codeCoverageIgnore |
||
230 | * @param array $extWhitelist |
||
231 | * @return bool |
||
232 | */ |
||
233 | public function checkUrlExtension( $extWhitelist = [] ) { |
||
236 | |||
237 | /** |
||
238 | * @codeCoverageIgnore |
||
239 | * @return string |
||
240 | */ |
||
241 | protected function getRawIP() { |
||
244 | } |
||
245 |
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.