From 715019f07354cdf462815c0a970700038e5e9769 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 2 Dec 2024 09:58:48 +1300 Subject: [PATCH] API Make parameter non-optional for PHP 8.4 --- code/Forms/AssetFormFactory.php | 6 +++--- code/Forms/FileFormFactory.php | 6 +++--- code/Forms/FileHistoryFormFactory.php | 4 ++-- code/Forms/FileSearchFormFactory.php | 2 +- code/Forms/FolderCreateFormFactory.php | 2 +- code/Forms/FolderFormFactory.php | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/code/Forms/AssetFormFactory.php b/code/Forms/AssetFormFactory.php index 463226bba..13b2e55a7 100644 --- a/code/Forms/AssetFormFactory.php +++ b/code/Forms/AssetFormFactory.php @@ -110,7 +110,7 @@ public function getForm(?RequestHandler $controller = null, $name = FormFactory: * @param $context * @return RequiredFields */ - protected function getValidator(?RequestHandler $controller = null, $formName, $context = []) + protected function getValidator(?RequestHandler $controller, $formName, $context = []) { $validator = new RequiredFields('Name'); @@ -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; @@ -224,7 +224,7 @@ protected function getFormActions(?RequestHandler $controller = null, $formName, * @param array $context * @return FieldList */ - protected function getFormFields(?RequestHandler $controller = null, $formName, $context = []) + protected function getFormFields(?RequestHandler $controller, $formName, $context = []) { /** @var File $record */ $record = isset($context['Record']) ? $context['Record'] : null; diff --git a/code/Forms/FileFormFactory.php b/code/Forms/FileFormFactory.php index 0b13988ae..57bee0abe 100644 --- a/code/Forms/FileFormFactory.php +++ b/code/Forms/FileFormFactory.php @@ -198,7 +198,7 @@ protected function getFormFieldHistoryTab($record, $context = []) * @param array $context * @return FieldList */ - protected function getFormFields(?RequestHandler $controller = null, $formName, $context = []) + protected function getFormFields(?RequestHandler $controller, $formName, $context = []) { /** @var File $record */ $record = $context['Record']; @@ -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; @@ -505,7 +505,7 @@ public function getRequiredContext() * @param $context * @return RequiredFields */ - protected function getValidator(?RequestHandler $controller = null, $formName, $context = []) + protected function getValidator(?RequestHandler $controller, $formName, $context = []) { $validator = parent::getValidator($controller, $formName, $context); 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;