Dead code removal (constructor type-hints are sufficient)

Thanks to @lcobucci for making me notice this.
This commit is contained in:
Marco Pivetta 2015-12-11 01:30:07 +01:00
parent b694829084
commit ffda95334f

View File

@ -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);