@@ -298,7 +298,6 @@ discard block |
||
298 | 298 | * Simulates a form post to the test controller with the specified file tuple (Filename, Hash, Variant) |
299 | 299 | * |
300 | 300 | * @param string $fileField Name of field to assign ids to |
301 | - * @param array $ids list of file IDs |
|
302 | 301 | * @return boolean Array with key 'errors' |
303 | 302 | */ |
304 | 303 | protected function mockUploadFileSave($fileField, $filename, $hash, $variant = null) { |
@@ -328,7 +327,7 @@ discard block |
||
328 | 327 | * Simulates a file upload |
329 | 328 | * |
330 | 329 | * @param string $fileField Name of the field to mock upload for |
331 | - * @param array $tmpFileName Name of temporary file to upload |
|
330 | + * @param string $tmpFileName Name of temporary file to upload |
|
332 | 331 | * @return SS_HTTPResponse form response |
333 | 332 | */ |
334 | 333 | protected function mockFileUpload($fileField, $tmpFileName) { |
@@ -360,6 +359,9 @@ discard block |
||
360 | 359 | return $this->record; |
361 | 360 | } |
362 | 361 | |
362 | + /** |
|
363 | + * @param AssetFieldTest_Controller $controller |
|
364 | + */ |
|
363 | 365 | function __construct($controller = null, $name = 'Form') { |
364 | 366 | if(empty($controller)) { |
365 | 367 | $controller = new AssetFieldTest_Controller(); |
@@ -936,7 +936,7 @@ discard block |
||
936 | 936 | * Simulates a file upload |
937 | 937 | * |
938 | 938 | * @param string $fileField Name of the field to mock upload for |
939 | - * @param array $tmpFileName Name of temporary file to upload |
|
939 | + * @param string $tmpFileName Name of temporary file to upload |
|
940 | 940 | * @return SS_HTTPResponse form response |
941 | 941 | */ |
942 | 942 | protected function mockFileUpload($fileField, $tmpFileName) { |
@@ -948,6 +948,9 @@ discard block |
||
948 | 948 | ); |
949 | 949 | } |
950 | 950 | |
951 | + /** |
|
952 | + * @param string $fileField |
|
953 | + */ |
|
951 | 954 | protected function mockFileExists($fileField, $fileName) { |
952 | 955 | return $this->get( |
953 | 956 | "UploadFieldTest_Controller/Form/field/{$fileField}/fileexists?filename=".urlencode($fileName) |
@@ -1075,6 +1078,9 @@ discard block |
||
1075 | 1078 | return $this->record; |
1076 | 1079 | } |
1077 | 1080 | |
1081 | + /** |
|
1082 | + * @param UploadFieldTest_Controller $controller |
|
1083 | + */ |
|
1078 | 1084 | function __construct($controller = null, $name = 'Form') { |
1079 | 1085 | if(empty($controller)) { |
1080 | 1086 | $controller = new UploadFieldTest_Controller(); |
@@ -580,6 +580,8 @@ discard block |
||
580 | 580 | /** |
581 | 581 | * Execute a log-in form using Director::test(). |
582 | 582 | * Helper method for the tests above |
583 | + * @param string $email |
|
584 | + * @param string $password |
|
583 | 585 | */ |
584 | 586 | public function doTestLoginForm($email, $password, $backURL = 'test/link') { |
585 | 587 | $this->get(Config::inst()->get('Security', 'logout_url')); |
@@ -600,6 +602,8 @@ discard block |
||
600 | 602 | |
601 | 603 | /** |
602 | 604 | * Helper method to execute a change password form |
605 | + * @param string $oldPassword |
|
606 | + * @param string $newPassword |
|
603 | 607 | */ |
604 | 608 | public function doTestChangepasswordForm($oldPassword, $newPassword) { |
605 | 609 | return $this->submitForm( |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | /** |
192 | 192 | * Gets the combined configuration of all LeafAndMain subclasses required by the client app. |
193 | 193 | * |
194 | - * @return array |
|
194 | + * @return string |
|
195 | 195 | * |
196 | 196 | * WARNING: Experimental API |
197 | 197 | */ |
@@ -881,6 +881,7 @@ discard block |
||
881 | 881 | * Return a list of appropriate templates for this class, with the given suffix using |
882 | 882 | * {@link SSViewer::get_templates_by_class()} |
883 | 883 | * |
884 | + * @param string $suffix |
|
884 | 885 | * @return array |
885 | 886 | */ |
886 | 887 | public function getTemplatesWithSuffix($suffix) { |
@@ -1750,7 +1751,7 @@ discard block |
||
1750 | 1751 | * The controller might not have any previewable content, in which case |
1751 | 1752 | * this method returns FALSE. |
1752 | 1753 | * |
1753 | - * @return String|boolean |
|
1754 | + * @return boolean |
|
1754 | 1755 | */ |
1755 | 1756 | public function LinkPreview() { |
1756 | 1757 | return false; |
@@ -1937,7 +1938,7 @@ discard block |
||
1937 | 1938 | } |
1938 | 1939 | |
1939 | 1940 | /** |
1940 | - * @return String |
|
1941 | + * @return DBField |
|
1941 | 1942 | */ |
1942 | 1943 | public function Locale() { |
1943 | 1944 | return DBField::create_field('Locale', i18n::get_locale()); |
@@ -2103,6 +2104,9 @@ discard block |
||
2103 | 2104 | return (parent::isFinished() || $this->isFinished); |
2104 | 2105 | } |
2105 | 2106 | |
2107 | + /** |
|
2108 | + * @param boolean $bool |
|
2109 | + */ |
|
2106 | 2110 | public function setIsFinished($bool) { |
2107 | 2111 | $this->isFinished = $bool; |
2108 | 2112 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | /** |
195 | 195 | * REST endpoint to get a list of campaigns. |
196 | 196 | * |
197 | - * @param SS_HTTPRequest $request |
|
197 | + * @param HTTPRequest $request |
|
198 | 198 | * |
199 | 199 | * @return HTTPResponse |
200 | 200 | */ |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | /** |
336 | 336 | * Gets viewable list of campaigns |
337 | 337 | * |
338 | - * @return SS_List |
|
338 | + * @return SilverStripe\Model\ArrayList |
|
339 | 339 | */ |
340 | 340 | protected function getListItems() { |
341 | 341 | return ChangeSet::get() |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | /** |
350 | 350 | * REST endpoint to get a campaign. |
351 | 351 | * |
352 | - * @param SS_HTTPRequest $request |
|
352 | + * @param HTTPRequest $request |
|
353 | 353 | * |
354 | 354 | * @return HTTPResponse |
355 | 355 | */ |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | /** |
383 | 383 | * REST endpoint to delete a campaign. |
384 | 384 | * |
385 | - * @param SS_HTTPRequest $request |
|
385 | + * @param HTTPRequest $request |
|
386 | 386 | * |
387 | 387 | * @return HTTPResponse |
388 | 388 | */ |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | /** |
410 | 410 | * REST endpoint to publish a {@link ChangeSet} and all of its items. |
411 | 411 | * |
412 | - * @param SS_HTTPRequest $request |
|
412 | + * @param HTTPRequest $request |
|
413 | 413 | * |
414 | 414 | * @return HTTPResponse |
415 | 415 | */ |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * $this->pushCurrent() and end the method with $this->popCurrent(). Failure to do this will create |
144 | 144 | * weird session errors. |
145 | 145 | * |
146 | - * @param SS_HTTPRequest $request |
|
146 | + * @param HTTPRequest $request |
|
147 | 147 | * @param DataModel $model |
148 | 148 | * |
149 | 149 | * @return HTTPResponse |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | /** |
282 | 282 | * Sets the SS_HTTPResponse object that this controller is building up. |
283 | 283 | * |
284 | - * @param SS_HTTPResponse $response |
|
284 | + * @param HTTPResponse $response |
|
285 | 285 | * |
286 | 286 | * @return $this |
287 | 287 | */ |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | * |
323 | 323 | * @param string $action |
324 | 324 | * |
325 | - * @return HTMLText |
|
325 | + * @return \SilverStripe\Model\FieldType\DBField |
|
326 | 326 | */ |
327 | 327 | public function defaultAction($action) { |
328 | 328 | return $this->getViewer($action)->process($this); |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | * |
459 | 459 | * @param array $params |
460 | 460 | * |
461 | - * @return string |
|
461 | + * @return \SilverStripe\Model\FieldType\DBField |
|
462 | 462 | */ |
463 | 463 | public function render($params = null) { |
464 | 464 | $template = $this->getViewer($this->getAction()); |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | * Tests whether a redirection has been requested. If redirect() has been called, it will return |
624 | 624 | * the URL redirected to. Otherwise, it will return null. |
625 | 625 | * |
626 | - * @return null|string |
|
626 | + * @return boolean |
|
627 | 627 | */ |
628 | 628 | public function redirectedTo() { |
629 | 629 | return $this->getResponse() && $this->getResponse()->getHeader('Location'); |
@@ -4,11 +4,9 @@ |
||
4 | 4 | |
5 | 5 | use Deprecation; |
6 | 6 | use SQLExpression; |
7 | - |
|
8 | 7 | use InvalidArgumentException; |
9 | 8 | use Config; |
10 | 9 | use LogicException; |
11 | - |
|
12 | 10 | use Injector; |
13 | 11 | use SilverStripe\Model\Connect\Database; |
14 | 12 | use SilverStripe\Control\Director; |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | * @param array|Cookie_Backend $cookies to populate $_COOKIE. |
279 | 279 | * @param HTTP_Request $request The {@see HTTP_Request} object generated as a part of this request. |
280 | 280 | * |
281 | - * @return SilverStripe\Control\HTTPResponse |
|
281 | + * @return HTTPResponse |
|
282 | 282 | * |
283 | 283 | * @throws SilverStripe\Control\HTTPResponse_Exception |
284 | 284 | */ |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | /** |
415 | 415 | * Handle an HTTP request, defined with a SS_HTTPRequest object. |
416 | 416 | * |
417 | - * @param SS_HTTPRequest $request |
|
417 | + * @param HTTPRequest $request |
|
418 | 418 | * @param Session $session |
419 | 419 | * @param DataModel $model |
420 | 420 | * |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | * Returns the domain part of the URL 'http://www.mysite.com'. Returns FALSE is this environment |
561 | 561 | * variable isn't set. |
562 | 562 | * |
563 | - * @return bool|string |
|
563 | + * @return string|false |
|
564 | 564 | */ |
565 | 565 | public static function protocolAndHost() { |
566 | 566 | $alternate = Config::inst()->get('SilverStripe\Control\Director', 'alternate_base_url'); |
@@ -893,7 +893,7 @@ discard block |
||
893 | 893 | /** |
894 | 894 | * Returns true if the given file exists. Filename should be relative to the site root. |
895 | 895 | * |
896 | - * @param $file |
|
896 | + * @param string $file |
|
897 | 897 | * |
898 | 898 | * @return bool |
899 | 899 | */ |
@@ -1111,7 +1111,7 @@ discard block |
||
1111 | 1111 | * Can also be checked with {@link Director::isDev()}, {@link Director::isTest()}, and |
1112 | 1112 | * {@link Director::isLive()}. |
1113 | 1113 | * |
1114 | - * @return bool|string |
|
1114 | + * @return string|false |
|
1115 | 1115 | */ |
1116 | 1116 | public static function get_environment_type() { |
1117 | 1117 | if (Director::isLive()) { |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | * |
132 | 132 | * @param string The new URL |
133 | 133 | * |
134 | - * @return SS_HTTPRequest The updated request |
|
134 | + * @return HTTPRequest The updated request |
|
135 | 135 | */ |
136 | 136 | public function setUrl($url) { |
137 | 137 | $this->url = $url; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | |
188 | 188 | /** |
189 | 189 | * @param string $body |
190 | - * @return SS_HTTPRequest $this |
|
190 | + * @return HTTPRequest $this |
|
191 | 191 | */ |
192 | 192 | public function setBody($body) { |
193 | 193 | $this->body = $body; |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | } |
196 | 196 | |
197 | 197 | /** |
198 | - * @return null|string |
|
198 | + * @return string |
|
199 | 199 | */ |
200 | 200 | public function getBody() { |
201 | 201 | return $this->body; |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | |
245 | 245 | /** |
246 | 246 | * @param string $name |
247 | - * @return mixed |
|
247 | + * @return string |
|
248 | 248 | */ |
249 | 249 | public function requestVar($name) { |
250 | 250 | if(isset($this->postVars[$name])) return $this->postVars[$name]; |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | * Remove an existing HTTP header |
298 | 298 | * |
299 | 299 | * @param string $header |
300 | - * @return mixed |
|
300 | + * @return string |
|
301 | 301 | */ |
302 | 302 | public function getHeader($header) { |
303 | 303 | return (isset($this->headers[$header])) ? $this->headers[$header] : null; |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | * e.g. "Content-Type". |
309 | 309 | * |
310 | 310 | * @param string $header |
311 | - * @return SS_HTTPRequest $this |
|
311 | + * @return HTTPRequest $this |
|
312 | 312 | */ |
313 | 313 | public function removeHeader($header) { |
314 | 314 | if(isset($this->headers[$header])) unset($this->headers[$header]); |
@@ -394,9 +394,9 @@ discard block |
||
394 | 394 | * it's only advisable to send small files through this method. |
395 | 395 | * |
396 | 396 | * @static |
397 | - * @param $fileData |
|
397 | + * @param string $fileData |
|
398 | 398 | * @param $fileName |
399 | - * @param null $mimeType |
|
399 | + * @param string $mimeType |
|
400 | 400 | * @return HTTPResponse |
401 | 401 | */ |
402 | 402 | public static function send_file($fileData, $fileName, $mimeType = null) { |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | |
572 | 572 | /** |
573 | 573 | * @param $params |
574 | - * @return SS_HTTPRequest $this |
|
574 | + * @return HTTPRequest $this |
|
575 | 575 | */ |
576 | 576 | public function setRouteParams($params) { |
577 | 577 | $this->routeParams = $params; |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | * This is used by the request handler to prevent infinite parsing loops. |
615 | 615 | * |
616 | 616 | * @param $pattern |
617 | - * @return bool |
|
617 | + * @return boolean|null |
|
618 | 618 | */ |
619 | 619 | public function isEmptyPattern($pattern) { |
620 | 620 | if(preg_match('/^([A-Za-z]+) +(.*)$/', $pattern, $matches)) { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * No newlines are allowed in the description. |
121 | 121 | * If omitted, will default to the standard HTTP description |
122 | 122 | * for the given $code value (see {@link $status_codes}). |
123 | - * @return SS_HTTPRequest $this |
|
123 | + * @return HTTPResponse $this |
|
124 | 124 | */ |
125 | 125 | public function setStatusCode($code, $description = null) { |
126 | 126 | if(isset(self::$status_codes[$code])) $this->statusCode = $code; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * Caution: Will be overwritten by {@link setStatusCode()}. |
137 | 137 | * |
138 | 138 | * @param string $description |
139 | - * @return SS_HTTPRequest $this |
|
139 | + * @return HTTPResponse $this |
|
140 | 140 | */ |
141 | 141 | public function setStatusDescription($description) { |
142 | 142 | $this->statusDescription = $description; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | /** |
170 | 170 | * @param string $body |
171 | - * @return SS_HTTPRequest $this |
|
171 | + * @return HTTPResponse $this |
|
172 | 172 | */ |
173 | 173 | public function setBody($body) { |
174 | 174 | $this->body = $body ? (string) $body : $body; // Don't type-cast false-ish values, eg null is null not '' |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
179 | - * @return null|string |
|
179 | + * @return string |
|
180 | 180 | */ |
181 | 181 | public function getBody() { |
182 | 182 | return $this->body; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * |
188 | 188 | * @param string $header Example: "Content-Type" |
189 | 189 | * @param string $value Example: "text/xml" |
190 | - * @return SS_HTTPRequest $this |
|
190 | + * @return HTTPResponse $this |
|
191 | 191 | */ |
192 | 192 | public function addHeader($header, $value) { |
193 | 193 | $this->headers[$header] = $value; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | * e.g. "Content-Type". |
218 | 218 | * |
219 | 219 | * @param string $header |
220 | - * @return SS_HTTPRequest $this |
|
220 | + * @return HTTPResponse $this |
|
221 | 221 | */ |
222 | 222 | public function removeHeader($header) { |
223 | 223 | if(isset($this->headers[$header])) unset($this->headers[$header]); |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | /** |
228 | 228 | * @param string $dest |
229 | 229 | * @param int $code |
230 | - * @return SS_HTTPRequest $this |
|
230 | + * @return HTTPResponse $this |
|
231 | 231 | */ |
232 | 232 | public function redirect($dest, $code=302) { |
233 | 233 | if(!in_array($code, self::$redirect_codes)) $code = 302; |
@@ -327,6 +327,7 @@ discard block |
||
327 | 327 | * @param string|SS_HTTPResponse body Either the plaintext content of the error message, or an SS_HTTPResponse |
328 | 328 | * object representing it. In either case, the $statusCode and |
329 | 329 | * $statusDescription will be the HTTP status of the resulting response. |
330 | + * @param string $statusDescription |
|
330 | 331 | * @see SS_HTTPResponse::__construct(); |
331 | 332 | */ |
332 | 333 | public function __construct($body = null, $statusCode = null, $statusDescription = null) { |
@@ -356,7 +357,7 @@ discard block |
||
356 | 357 | } |
357 | 358 | |
358 | 359 | /** |
359 | - * @param SS_HTTPResponse $response |
|
360 | + * @param HTTPResponse $response |
|
360 | 361 | */ |
361 | 362 | public function setResponse(HTTPResponse $response) { |
362 | 363 | $this->response = $response; |