@@ -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; |
@@ -49,7 +49,6 @@ discard block |
||
| 49 | 49 | protected $fragmentOverride = null; |
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | - * @param RequestHandler $controller |
|
| 53 | 52 | * @param SS_HTTPResponse An existing response to reuse (optional) |
| 54 | 53 | * @param Array $callbacks |
| 55 | 54 | */ |
@@ -71,11 +70,10 @@ discard block |
||
| 71 | 70 | * Out of the box, the handler "CurrentForm" value, which will return the rendered form. |
| 72 | 71 | * Non-Ajax calls will redirect back. |
| 73 | 72 | * |
| 74 | - * @param SS_HTTPRequest $request |
|
| 73 | + * @param HTTPRequest $request |
|
| 75 | 74 | * @param array $extraCallbacks List of anonymous functions or callables returning either a string |
| 76 | 75 | * or SS_HTTPResponse, keyed by their fragment identifier. The 'default' key can |
| 77 | 76 | * be used as a fallback for non-ajax responses. |
| 78 | - * @param array $fragmentOverride Change the response fragments. |
|
| 79 | 77 | * @return HTTPResponse |
| 80 | 78 | */ |
| 81 | 79 | public function respond(HTTPRequest $request, $extraCallbacks = array()) { |
@@ -123,7 +121,7 @@ discard block |
||
| 123 | 121 | /** |
| 124 | 122 | * Set up fragment overriding - will completely replace the incoming fragments. |
| 125 | 123 | * |
| 126 | - * @param array $fragments Fragments to insert. |
|
| 124 | + * @param string[] $fragments Fragments to insert. |
|
| 127 | 125 | */ |
| 128 | 126 | public function setFragmentOverride($fragments) { |
| 129 | 127 | if (!is_array($fragments)) throw new InvalidArgumentException(); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | /** |
| 69 | 69 | * Returns the {@link Session} object for this test |
| 70 | 70 | * |
| 71 | - * @return Session |
|
| 71 | + * @return Session|null |
|
| 72 | 72 | */ |
| 73 | 73 | public function session() { |
| 74 | 74 | return $this->mainSession->session(); |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | * Find an attribute in a SimpleXMLElement object by name. |
| 218 | 218 | * @param SimpleXMLElement $object |
| 219 | 219 | * @param string $attribute Name of attribute to find |
| 220 | - * @return SimpleXMLElement object of the attribute |
|
| 220 | + * @return boolean object of the attribute |
|
| 221 | 221 | */ |
| 222 | 222 | public function findAttribute($object, $attribute) { |
| 223 | 223 | $found = false; |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | * Note: characters are stripped from the content; make sure that your assertions take this into account. |
| 248 | 248 | * |
| 249 | 249 | * @param string $selector A basic CSS selector, e.g. 'li.jobs h3' |
| 250 | - * @param array|string $expectedMatches The content of at least one of the matched tags |
|
| 250 | + * @param string[] $expectedMatches The content of at least one of the matched tags |
|
| 251 | 251 | * @throws PHPUnit_Framework_AssertionFailedError |
| 252 | 252 | * @return boolean |
| 253 | 253 | */ |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | * @param string $selector A basic CSS selector, e.g. 'li.jobs h3' |
| 345 | 345 | * @param array|string $expectedMatches The content of *all* matched tags as an array |
| 346 | 346 | * @throws PHPUnit_Framework_AssertionFailedError |
| 347 | - * @return boolean |
|
| 347 | + * @return boolean|null |
|
| 348 | 348 | */ |
| 349 | 349 | public function assertExactHTMLMatchBySelector($selector, $expectedMatches) { |
| 350 | 350 | $items = $this->cssParser()->getBySelector($selector); |
@@ -151,7 +151,6 @@ discard block |
||
| 151 | 151 | * |
| 152 | 152 | * @param string $name The internal field name, passed to forms. |
| 153 | 153 | * @param string $title The field label. |
| 154 | - * @param Form $form Reference to the container form |
|
| 155 | 154 | */ |
| 156 | 155 | public function __construct($name, $title = null) { |
| 157 | 156 | $this->addExtraClass('ss-upload'); // class, used by js |
@@ -263,6 +262,10 @@ discard block |
||
| 263 | 262 | return $this->record; |
| 264 | 263 | } |
| 265 | 264 | |
| 265 | + /** |
|
| 266 | + * @param null|DataObject $value |
|
| 267 | + * @param DataObject $record |
|
| 268 | + */ |
|
| 266 | 269 | public function setValue($value, $record = null) { |
| 267 | 270 | // Extract value from underlying record |
| 268 | 271 | if(empty($value) && $this->getName() && $record instanceof DataObject) { |
@@ -700,7 +703,7 @@ discard block |
||
| 700 | 703 | /** |
| 701 | 704 | * Action to handle upload of a single file |
| 702 | 705 | * |
| 703 | - * @param SS_HTTPRequest $request |
|
| 706 | + * @param HTTPRequest $request |
|
| 704 | 707 | * @return HTTPResponse |
| 705 | 708 | */ |
| 706 | 709 | public function upload(HTTPRequest $request) { |
@@ -223,7 +223,6 @@ discard block |
||
| 223 | 223 | * @param string $title The field label. |
| 224 | 224 | * @param SS_List $items If no items are defined, the field will try to auto-detect an existing relation on |
| 225 | 225 | * @link $record}, with the same name as the field name. |
| 226 | - * @param Form $form Reference to the container form |
|
| 227 | 226 | */ |
| 228 | 227 | public function __construct($name, $title = null, SS_List $items = null) { |
| 229 | 228 | |
@@ -1073,7 +1072,7 @@ discard block |
||
| 1073 | 1072 | } |
| 1074 | 1073 | |
| 1075 | 1074 | /** |
| 1076 | - * @param SS_HTTPRequest $request |
|
| 1075 | + * @param HTTPRequest $request |
|
| 1077 | 1076 | * @return UploadField_ItemHandler |
| 1078 | 1077 | */ |
| 1079 | 1078 | public function handleItem(HTTPRequest $request) { |
@@ -1089,8 +1088,8 @@ discard block |
||
| 1089 | 1088 | } |
| 1090 | 1089 | |
| 1091 | 1090 | /** |
| 1092 | - * @param SS_HTTPRequest $request |
|
| 1093 | - * @return UploadField_ItemHandler |
|
| 1091 | + * @param HTTPRequest $request |
|
| 1092 | + * @return UploadField_SelectHandler |
|
| 1094 | 1093 | */ |
| 1095 | 1094 | public function handleSelect(HTTPRequest $request) { |
| 1096 | 1095 | if(!$this->canAttachExisting()) return $this->httpError(403); |
@@ -1212,7 +1211,7 @@ discard block |
||
| 1212 | 1211 | /** |
| 1213 | 1212 | * Action to handle upload of a single file |
| 1214 | 1213 | * |
| 1215 | - * @param SS_HTTPRequest $request |
|
| 1214 | + * @param HTTPRequest $request |
|
| 1216 | 1215 | * @return HTTPResponse |
| 1217 | 1216 | * @return HTTPResponse |
| 1218 | 1217 | */ |
@@ -1255,7 +1254,7 @@ discard block |
||
| 1255 | 1254 | * Retrieves details for files that this field wishes to attache to the |
| 1256 | 1255 | * client-side form |
| 1257 | 1256 | * |
| 1258 | - * @param SS_HTTPRequest $request |
|
| 1257 | + * @param HTTPRequest $request |
|
| 1259 | 1258 | * @return HTTPResponse |
| 1260 | 1259 | */ |
| 1261 | 1260 | public function attach(HTTPRequest $request) { |
@@ -1297,7 +1296,7 @@ discard block |
||
| 1297 | 1296 | /** |
| 1298 | 1297 | * Determines if a specified file exists |
| 1299 | 1298 | * |
| 1300 | - * @param SS_HTTPRequest $request |
|
| 1299 | + * @param HTTPRequest $request |
|
| 1301 | 1300 | */ |
| 1302 | 1301 | public function fileexists(HTTPRequest $request) { |
| 1303 | 1302 | // Assert that requested filename doesn't attempt to escape the directory |
@@ -1425,7 +1424,7 @@ discard block |
||
| 1425 | 1424 | /** |
| 1426 | 1425 | * Action to handle deleting of a single file |
| 1427 | 1426 | * |
| 1428 | - * @param SS_HTTPRequest $request |
|
| 1427 | + * @param HTTPRequest $request |
|
| 1429 | 1428 | * @return HTTPResponse |
| 1430 | 1429 | */ |
| 1431 | 1430 | public function delete(HTTPRequest $request) { |
@@ -1451,8 +1450,8 @@ discard block |
||
| 1451 | 1450 | /** |
| 1452 | 1451 | * Action to handle editing of a single file |
| 1453 | 1452 | * |
| 1454 | - * @param SS_HTTPRequest $request |
|
| 1455 | - * @return ViewableData_Customised |
|
| 1453 | + * @param HTTPRequest $request |
|
| 1454 | + * @return DBField |
|
| 1456 | 1455 | */ |
| 1457 | 1456 | public function edit(HTTPRequest $request) { |
| 1458 | 1457 | // Check form field state |
@@ -1500,7 +1499,7 @@ discard block |
||
| 1500 | 1499 | /** |
| 1501 | 1500 | * @param array $data |
| 1502 | 1501 | * @param Form $form |
| 1503 | - * @param SS_HTTPRequest $request |
|
| 1502 | + * @param HTTPRequest $request |
|
| 1504 | 1503 | */ |
| 1505 | 1504 | public function doEdit(array $data, Form $form, HTTPRequest $request) { |
| 1506 | 1505 | // Check form field state |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | * |
| 76 | 76 | * @param array $data |
| 77 | 77 | * @param Form $form |
| 78 | - * @return HTTPResponse |
|
| 78 | + * @return SilverStripe\Control\HTTPResponse |
|
| 79 | 79 | */ |
| 80 | 80 | public function doArchive($data, $form) { |
| 81 | 81 | $record = $this->getRecord(); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | /** |
| 67 | 67 | * Assign a new configuration instance or identifier |
| 68 | 68 | * |
| 69 | - * @param string|HtmlEditorConfig $config |
|
| 69 | + * @param string $config |
|
| 70 | 70 | * @return $this |
| 71 | 71 | */ |
| 72 | 72 | public function setEditorConfig($config) { |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * |
| 81 | 81 | * @param string $name The internal field name, passed to forms. |
| 82 | 82 | * @param string $title The human-readable field label. |
| 83 | - * @param mixed $value The value of the field. |
|
| 83 | + * @param integer $value The value of the field. |
|
| 84 | 84 | * @param string $config HtmlEditorConfig identifier to be used. Default to the active one. |
| 85 | 85 | */ |
| 86 | 86 | public function __construct($name, $title = null, $value = '', $config = null) { |
@@ -121,6 +121,9 @@ discard block |
||
| 121 | 121 | $record->{$this->name} = $htmlValue->getContent(); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | + /** |
|
| 125 | + * @param string|null $value |
|
| 126 | + */ |
|
| 124 | 127 | public function setValue($value) { |
| 125 | 128 | // Regenerate links prior to preview, so that the editor can see them. |
| 126 | 129 | $value = Image::regenerate_html_links($value); |
@@ -188,6 +191,10 @@ discard block |
||
| 188 | 191 | |
| 189 | 192 | protected $controller, $name; |
| 190 | 193 | |
| 194 | + /** |
|
| 195 | + * @param Controller|null $controller |
|
| 196 | + * @param string $name |
|
| 197 | + */ |
|
| 191 | 198 | public function __construct($controller, $name) { |
| 192 | 199 | parent::__construct(); |
| 193 | 200 | |
@@ -206,7 +213,7 @@ discard block |
||
| 206 | 213 | /** |
| 207 | 214 | * Searches the SiteTree for display in the dropdown |
| 208 | 215 | * |
| 209 | - * @return callback |
|
| 216 | + * @return DataList |
|
| 210 | 217 | */ |
| 211 | 218 | public function siteTreeSearchCallback($sourceObject, $labelField, $search) { |
| 212 | 219 | return DataObject::get($sourceObject)->filterAny(array( |
@@ -491,7 +498,7 @@ discard block |
||
| 491 | 498 | * |
| 492 | 499 | * @param string $message |
| 493 | 500 | * @param int $code |
| 494 | - * @return SS_HTTPResponse_Exception |
|
| 501 | + * @return HTTPResponse_Exception |
|
| 495 | 502 | */ |
| 496 | 503 | protected function getErrorFor($message, $code = 400) { |
| 497 | 504 | $exception = new HTTPResponse_Exception($message, $code); |
@@ -586,7 +593,7 @@ discard block |
||
| 586 | 593 | /** |
| 587 | 594 | * Find all anchors available on the given page. |
| 588 | 595 | * |
| 589 | - * @return array |
|
| 596 | + * @return string |
|
| 590 | 597 | * @throws SS_HTTPResponse_Exception |
| 591 | 598 | */ |
| 592 | 599 | public function getanchors() { |
@@ -1145,7 +1152,7 @@ discard block |
||
| 1145 | 1152 | /** |
| 1146 | 1153 | * Get OEmbed type |
| 1147 | 1154 | * |
| 1148 | - * @return string |
|
| 1155 | + * @return boolean |
|
| 1149 | 1156 | */ |
| 1150 | 1157 | public function getType() { |
| 1151 | 1158 | return $this->oembed->type; |