diff --git a/src/Forms/DefaultFormFactory.php b/src/Forms/DefaultFormFactory.php index 733f8cc085f..842536cbae2 100644 --- a/src/Forms/DefaultFormFactory.php +++ b/src/Forms/DefaultFormFactory.php @@ -64,7 +64,7 @@ public function getForm(?RequestHandler $controller = null, $name = FormFactory: * @param array $context * @return FieldList */ - protected function getFormFields(?RequestHandler $controller = null, $name, $context = []) + protected function getFormFields(?RequestHandler $controller, $name, $context = []) { // Fall back to standard "getCMSFields" which itself uses the FormScaffolder as a fallback $fields = $context['Record']->getCMSFields(); @@ -80,7 +80,7 @@ protected function getFormFields(?RequestHandler $controller = null, $name, $con * @param array $context * @return FieldList */ - protected function getFormActions(?RequestHandler $controller = null, $name, $context = []) + protected function getFormActions(?RequestHandler $controller, $name, $context = []) { $actions = $context['Record']->getCMSActions(); $this->invokeWithExtensions('updateFormActions', $actions, $controller, $name, $context); @@ -93,7 +93,7 @@ protected function getFormActions(?RequestHandler $controller = null, $name, $co * @param array $context * @return null|Validator */ - protected function getFormValidator(?RequestHandler $controller = null, $name, $context = []) + protected function getFormValidator(?RequestHandler $controller, $name, $context = []) { if (!$context['Record'] instanceof DataObject) { return null; diff --git a/tests/php/Forms/FormFactoryTest/EditFormFactory.php b/tests/php/Forms/FormFactoryTest/EditFormFactory.php index 9bf2c8ddb2a..cc4c7684db9 100644 --- a/tests/php/Forms/FormFactoryTest/EditFormFactory.php +++ b/tests/php/Forms/FormFactoryTest/EditFormFactory.php @@ -18,7 +18,7 @@ class EditFormFactory extends DefaultFormFactory ControllerExtension::class ]; - protected function getFormFields(?RequestHandler $controller = null, $name, $context = []) + protected function getFormFields(?RequestHandler $controller, $name, $context = []) { $fields = new FieldList( new HiddenField('ID'), @@ -28,7 +28,7 @@ protected function getFormFields(?RequestHandler $controller = null, $name, $con return $fields; } - protected function getFormActions(?RequestHandler $controller = null, $name, $context = []) + protected function getFormActions(?RequestHandler $controller, $name, $context = []) { $actions = new FieldList( new FormAction('save', 'Save')