@@ -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,8 +703,8 @@ discard block |
||
700 | 703 | /** |
701 | 704 | * Action to handle upload of a single file |
702 | 705 | * |
703 | - * @param SS_HTTPRequest $request |
|
704 | - * @return SS_HTTPResponse |
|
706 | + * @param HTTPRequest $request |
|
707 | + * @return HTTPResponse |
|
705 | 708 | */ |
706 | 709 | public function upload(HTTPRequest $request) { |
707 | 710 | if($this->isDisabled() || $this->isReadonly() || !$this->canUpload()) { |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | } |
199 | 199 | |
200 | 200 | /** |
201 | - * @return ArrayList |
|
201 | + * @return SilverStripe\Model\ArrayList |
|
202 | 202 | */ |
203 | 203 | public function getComponents() { |
204 | 204 | return $this->config->getComponents(); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | * |
210 | 210 | * @todo refactor this into GridFieldComponent |
211 | 211 | * |
212 | - * @param mixed $value |
|
212 | + * @param string $value |
|
213 | 213 | * @param string|array $castingDefinition |
214 | 214 | * |
215 | 215 | * @return mixed |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | * |
297 | 297 | * @param array $properties |
298 | 298 | * |
299 | - * @return HTMLText |
|
299 | + * @return DBField |
|
300 | 300 | */ |
301 | 301 | public function FieldHolder($properties = array()) { |
302 | 302 | Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | /** |
611 | 611 | * @param array $properties |
612 | 612 | * |
613 | - * @return HTMLText |
|
613 | + * @return DBField |
|
614 | 614 | */ |
615 | 615 | public function Field($properties = array()) { |
616 | 616 | $this->extend('onBeforeRender', $this); |
@@ -849,7 +849,7 @@ discard block |
||
849 | 849 | * |
850 | 850 | * @param array $data |
851 | 851 | * @param Form $form |
852 | - * @param SS_HTTPRequest $request |
|
852 | + * @param HTTPRequest $request |
|
853 | 853 | * |
854 | 854 | * @return string |
855 | 855 | */ |
@@ -943,7 +943,7 @@ discard block |
||
943 | 943 | * |
944 | 944 | * @todo copy less code from RequestHandler. |
945 | 945 | * |
946 | - * @param SS_HTTPRequest $request |
|
946 | + * @param HTTPRequest $request |
|
947 | 947 | * @param DataModel $model |
948 | 948 | * |
949 | 949 | * @return array|RequestHandler|SS_HTTPResponse|string|void |
@@ -192,6 +192,7 @@ discard block |
||
192 | 192 | |
193 | 193 | /** |
194 | 194 | * @param String |
195 | + * @param string $class |
|
195 | 196 | */ |
196 | 197 | public function setItemRequestClass($class) { |
197 | 198 | $this->itemRequestClass = $class; |
@@ -299,6 +300,9 @@ discard block |
||
299 | 300 | parent::__construct(); |
300 | 301 | } |
301 | 302 | |
303 | + /** |
|
304 | + * @param string $action |
|
305 | + */ |
|
302 | 306 | public function Link($action = null) { |
303 | 307 | return Controller::join_links($this->gridField->Link('item'), |
304 | 308 | $this->record->ID ? $this->record->ID : 'new', $action); |
@@ -524,6 +528,9 @@ discard block |
||
524 | 528 | return $c; |
525 | 529 | } |
526 | 530 | |
531 | + /** |
|
532 | + * @return string |
|
533 | + */ |
|
527 | 534 | protected function getBackLink(){ |
528 | 535 | // TODO Coupling with CMS |
529 | 536 | $backlink = ''; |
@@ -625,6 +632,9 @@ discard block |
||
625 | 632 | } |
626 | 633 | } |
627 | 634 | |
635 | + /** |
|
636 | + * @param integer $errorCode |
|
637 | + */ |
|
628 | 638 | public function httpError($errorCode, $errorMessage = null) { |
629 | 639 | $controller = $this->getToplevelController(); |
630 | 640 | return $controller->httpError($errorCode, $errorMessage); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @param string $name the field name |
82 | 82 | * @param string $title the field label |
83 | - * @param string|array $sourceObject The object-type to list in the tree. This could |
|
83 | + * @param string $sourceObject The object-type to list in the tree. This could |
|
84 | 84 | * be one of the following: |
85 | 85 | * - A DataObject class name with the {@link Hierarchy} extension. |
86 | 86 | * - An array of key/value pairs, like a {@link DropdownField} source. In |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
211 | - * @return HTMLText |
|
211 | + * @return DBField |
|
212 | 212 | */ |
213 | 213 | public function Field($properties = array()) { |
214 | 214 | Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang'); |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | /** |
263 | 263 | * Get the whole tree of a part of the tree via an AJAX request. |
264 | 264 | * |
265 | - * @param SS_HTTPRequest $request |
|
265 | + * @param HTTPRequest $request |
|
266 | 266 | * @return string |
267 | 267 | */ |
268 | 268 | public function tree(HTTPRequest $request) { |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | * If a filter function has been set, that will be called. And if search text is set, |
390 | 390 | * filter on that too. Return true if all applicable conditions are true, false otherwise. |
391 | 391 | * @param $node |
392 | - * @return unknown_type |
|
392 | + * @return boolean |
|
393 | 393 | */ |
394 | 394 | public function filterMarking($node) { |
395 | 395 | if ($this->filterCallback && !call_user_func($this->filterCallback, $node)) return false; |
@@ -440,7 +440,6 @@ discard block |
||
440 | 440 | } |
441 | 441 | |
442 | 442 | /** |
443 | - * @param String $field |
|
444 | 443 | */ |
445 | 444 | public function setSourceObject($class) { |
446 | 445 | $this->sourceObject = $class; |
@@ -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,9 +1211,9 @@ discard block |
||
1212 | 1211 | /** |
1213 | 1212 | * Action to handle upload of a single file |
1214 | 1213 | * |
1215 | - * @param SS_HTTPRequest $request |
|
1216 | - * @return SS_HTTPResponse |
|
1217 | - * @return SS_HTTPResponse |
|
1214 | + * @param HTTPRequest $request |
|
1215 | + * @return HTTPResponse |
|
1216 | + * @return HTTPResponse |
|
1218 | 1217 | */ |
1219 | 1218 | public function upload(HTTPRequest $request) { |
1220 | 1219 | if($this->isDisabled() || $this->isReadonly() || !$this->canUpload()) { |
@@ -1255,8 +1254,8 @@ 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 |
|
1259 | - * @return SS_HTTPResponse |
|
1257 | + * @param HTTPRequest $request |
|
1258 | + * @return HTTPResponse |
|
1260 | 1259 | */ |
1261 | 1260 | public function attach(HTTPRequest $request) { |
1262 | 1261 | if(!$request->isPOST()) return $this->httpError(403); |
@@ -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 SS_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 |
@@ -1066,7 +1066,7 @@ discard block |
||
1066 | 1066 | /** |
1067 | 1067 | * Find objects in the given relationships, merging them into the given list |
1068 | 1068 | * |
1069 | - * @param array $source Config property to extract relationships from |
|
1069 | + * @param string $source Config property to extract relationships from |
|
1070 | 1070 | * @param bool $recursive True if recursive |
1071 | 1071 | * @param ArrayList $list Optional list to add items to |
1072 | 1072 | * @return ArrayList The list |
@@ -1186,7 +1186,7 @@ discard block |
||
1186 | 1186 | /** |
1187 | 1187 | * Check if the current user can delete this record from live |
1188 | 1188 | * |
1189 | - * @param null $member |
|
1189 | + * @param Member|null $member |
|
1190 | 1190 | * @return mixed |
1191 | 1191 | */ |
1192 | 1192 | public function canUnpublish($member = null) { |
@@ -1219,7 +1219,7 @@ discard block |
||
1219 | 1219 | * If extended, ensure that both canDelete and canUnpublish are extended also |
1220 | 1220 | * |
1221 | 1221 | * @param Member $member |
1222 | - * @return bool |
|
1222 | + * @return null|boolean |
|
1223 | 1223 | */ |
1224 | 1224 | public function canArchive($member = null) { |
1225 | 1225 | // Skip if invoked by extendedCan() |
@@ -1296,7 +1296,7 @@ discard block |
||
1296 | 1296 | * Extend permissions to include additional security for objects that are not published to live. |
1297 | 1297 | * |
1298 | 1298 | * @param Member $member |
1299 | - * @return bool|null |
|
1299 | + * @return false|null |
|
1300 | 1300 | */ |
1301 | 1301 | public function canView($member = null) { |
1302 | 1302 | // Invoke default version-gnostic canView |
@@ -1918,7 +1918,7 @@ discard block |
||
1918 | 1918 | /** |
1919 | 1919 | * Determine if the current user is able to set the given site stage / archive |
1920 | 1920 | * |
1921 | - * @param SS_HTTPRequest $request |
|
1921 | + * @param SilverStripe\Control\HTTPRequest $request |
|
1922 | 1922 | * @return bool |
1923 | 1923 | */ |
1924 | 1924 | public static function can_choose_site_stage($request) { |
@@ -2422,7 +2422,7 @@ discard block |
||
2422 | 2422 | /** |
2423 | 2423 | * Returns an array of possible stages. |
2424 | 2424 | * |
2425 | - * @return array |
|
2425 | + * @return string[] |
|
2426 | 2426 | */ |
2427 | 2427 | public function getVersionedStages() { |
2428 | 2428 | if($this->hasStages()) { |
@@ -13,7 +13,7 @@ |
||
13 | 13 | /** |
14 | 14 | * Constructor |
15 | 15 | * |
16 | - * @param Controller $controller The parent controller, necessary to |
|
16 | + * @param Controller|null $controller The parent controller, necessary to |
|
17 | 17 | * create the appropriate form action tag. |
18 | 18 | * @param string $name The method on the controller that will return this |
19 | 19 | * form object. |
@@ -188,7 +188,7 @@ |
||
188 | 188 | * |
189 | 189 | * @param int $code HTTP code |
190 | 190 | * @param string $body Body expected for 200 responses |
191 | - * @param SS_HTTPResponse $response |
|
191 | + * @param HTTPResponse $response |
|
192 | 192 | */ |
193 | 193 | protected function assertResponseEquals($code, $body, HTTPResponse $response) { |
194 | 194 | $this->assertEquals($code, $response->getStatusCode()); |
@@ -306,7 +306,6 @@ discard block |
||
306 | 306 | * Simulates a form post to the test controller with the specified file tuple (Filename, Hash, Variant) |
307 | 307 | * |
308 | 308 | * @param string $fileField Name of field to assign ids to |
309 | - * @param array $ids list of file IDs |
|
310 | 309 | * @return boolean Array with key 'errors' |
311 | 310 | */ |
312 | 311 | protected function mockUploadFileSave($fileField, $filename, $hash, $variant = null) { |
@@ -336,8 +335,8 @@ discard block |
||
336 | 335 | * Simulates a file upload |
337 | 336 | * |
338 | 337 | * @param string $fileField Name of the field to mock upload for |
339 | - * @param array $tmpFileName Name of temporary file to upload |
|
340 | - * @return SS_HTTPResponse form response |
|
338 | + * @param string $tmpFileName Name of temporary file to upload |
|
339 | + * @return SilverStripe\Control\SS_HTTPResponse|null form response |
|
341 | 340 | */ |
342 | 341 | protected function mockFileUpload($fileField, $tmpFileName) { |
343 | 342 | $upload = $this->getUploadFile($tmpFileName); |
@@ -368,6 +367,9 @@ discard block |
||
368 | 367 | return $this->record; |
369 | 368 | } |
370 | 369 | |
370 | + /** |
|
371 | + * @param AssetFieldTest_Controller $controller |
|
372 | + */ |
|
371 | 373 | function __construct($controller = null, $name = 'Form') { |
372 | 374 | if(empty($controller)) { |
373 | 375 | $controller = new AssetFieldTest_Controller(); |