Skip to content

Commit

Permalink
API Make parameter non-optional for PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Dec 1, 2024
1 parent a315cbe commit 1a3db3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Forms/DefaultFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions tests/php/Forms/FormFactoryTest/EditFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -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')
Expand Down

0 comments on commit 1a3db3d

Please sign in to comment.