mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Dead code removal (constructor type-hints are sufficient)
Thanks to @lcobucci for making me notice this.
This commit is contained in:
parent
b694829084
commit
ffda95334f
@ -229,21 +229,11 @@ class Form extends RequestHandler {
|
||||
* @param FieldList $fields All of the fields in the form - a {@link FieldList} of {@link FormField} objects.
|
||||
* @param FieldList $actions All of the action buttons in the form - a {@link FieldLis} of
|
||||
* {@link FormAction} objects
|
||||
* @param Validator $validator Override the default validator instance (Default: {@link RequiredFields})
|
||||
* @param Validator|null $validator Override the default validator instance (Default: {@link RequiredFields})
|
||||
*/
|
||||
public function __construct($controller, $name, FieldList $fields, FieldList $actions, $validator = null) {
|
||||
public function __construct($controller, $name, FieldList $fields, FieldList $actions, Validator $validator = null) {
|
||||
parent::__construct();
|
||||
|
||||
if(!$fields instanceof FieldList) {
|
||||
throw new InvalidArgumentException('$fields must be a valid FieldList instance');
|
||||
}
|
||||
if(!$actions instanceof FieldList) {
|
||||
throw new InvalidArgumentException('$actions must be a valid FieldList instance');
|
||||
}
|
||||
if($validator && !$validator instanceof Validator) {
|
||||
throw new InvalidArgumentException('$validator must be a Validator instance');
|
||||
}
|
||||
|
||||
$fields->setForm($this);
|
||||
$actions->setForm($this);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user