From 7cd4d4d70b7596875590f09c502921168ce2b5e2 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Sun, 1 Dec 2024 20:27:18 +1300 Subject: [PATCH] API Make parameter non-optional for PHP 8.4 --- code/Forms/AssetFormFactory.php | 2 +- code/Forms/FileFormFactory.php | 2 +- code/Forms/FileHistoryFormFactory.php | 4 ++-- code/Forms/FileSearchFormFactory.php | 2 +- code/Forms/FolderCreateFormFactory.php | 2 +- code/Forms/FolderFormFactory.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/code/Forms/AssetFormFactory.php b/code/Forms/AssetFormFactory.php index 463226bba..4c1db4dd4 100644 --- a/code/Forms/AssetFormFactory.php +++ b/code/Forms/AssetFormFactory.php @@ -199,7 +199,7 @@ protected function getDeleteAction($record) * @param array $context * @return FieldList */ - protected function getFormActions(?RequestHandler $controller = null, $formName, $context = []) + protected function getFormActions(?RequestHandler $controller, $formName, $context = []) { $record = isset($context['Record']) ? $context['Record'] : null; diff --git a/code/Forms/FileFormFactory.php b/code/Forms/FileFormFactory.php index 0b13988ae..302ab41c7 100644 --- a/code/Forms/FileFormFactory.php +++ b/code/Forms/FileFormFactory.php @@ -266,7 +266,7 @@ protected function getPublishAction($record) * @param array $context * @return FieldList */ - protected function getFormActions(?RequestHandler $controller = null, $formName, $context = []) + protected function getFormActions(?RequestHandler $controller, $formName, $context = []) { $record = $context['Record']; $fileSelected = $context['FileSelected'] ?? false; diff --git a/code/Forms/FileHistoryFormFactory.php b/code/Forms/FileHistoryFormFactory.php index 1167ed086..23ea50a05 100644 --- a/code/Forms/FileHistoryFormFactory.php +++ b/code/Forms/FileHistoryFormFactory.php @@ -47,7 +47,7 @@ protected function getSpecsMarkup($record) ); } - protected function getFormFields(?RequestHandler $controller = null, $name, $context = []) + protected function getFormFields(?RequestHandler $controller, $name, $context = []) { $record = $context['Record']; @@ -68,7 +68,7 @@ protected function getFormFields(?RequestHandler $controller = null, $name, $con } - protected function getFormActions(?RequestHandler $controller = null, $formName, $context = []) + protected function getFormActions(?RequestHandler $controller, $formName, $context = []) { $actions = new FieldList(); // Update diff --git a/code/Forms/FileSearchFormFactory.php b/code/Forms/FileSearchFormFactory.php index abecaeb71..4ce8c2791 100644 --- a/code/Forms/FileSearchFormFactory.php +++ b/code/Forms/FileSearchFormFactory.php @@ -49,7 +49,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 = []) { // Note: "Name" field is excluded as it is baked directly into the Search.js react component diff --git a/code/Forms/FolderCreateFormFactory.php b/code/Forms/FolderCreateFormFactory.php index ac8d15a88..3e29e8911 100644 --- a/code/Forms/FolderCreateFormFactory.php +++ b/code/Forms/FolderCreateFormFactory.php @@ -16,7 +16,7 @@ public function getRequiredContext() return ['ParentID']; } - public function getFormFields(?RequestHandler $controller = null, $name, $context = []) + public function getFormFields(?RequestHandler $controller, $name, $context = []) { // Add status flag before extensions are triggered $this->beforeExtending('updateFormFields', function (FieldList $fields) use ($context) { diff --git a/code/Forms/FolderFormFactory.php b/code/Forms/FolderFormFactory.php index afa290c70..6421df6c9 100644 --- a/code/Forms/FolderFormFactory.php +++ b/code/Forms/FolderFormFactory.php @@ -13,7 +13,7 @@ class FolderFormFactory extends AssetFormFactory { - protected function getFormFields(?RequestHandler $controller = null, $name, $context = []) + protected function getFormFields(?RequestHandler $controller, $name, $context = []) { /** @var Folder $record */ $record = $context['Record'] ?? null;