From c1cc0d5ac276ca2d24a8bb0eeccc498797a56a4a Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Thu, 28 Nov 2024 14:02:06 +1300 Subject: [PATCH] API Explicity mark nullable parameters for PHP 8.4 --- code/FormSchemaController.php | 2 +- code/Forms/LinkFormFactory.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/FormSchemaController.php b/code/FormSchemaController.php index e5e120934..409a9f9ab 100644 --- a/code/FormSchemaController.php +++ b/code/FormSchemaController.php @@ -111,7 +111,7 @@ public function schema(HTTPRequest $request): HTTPResponse * @param ValidationResult $errors Required for 'error' response * @param array $extraData Any extra data to be merged with the schema response */ - public function getSchemaResponse(string $schemaID, ?Form $form = null, ValidationResult $errors = null, array $extraData = []): HTTPResponse + public function getSchemaResponse(string $schemaID, ?Form $form = null, ?ValidationResult $errors = null, array $extraData = []): HTTPResponse { $parts = $this->getRequest()->getHeader(static::SCHEMA_HEADER); $data = $this diff --git a/code/Forms/LinkFormFactory.php b/code/Forms/LinkFormFactory.php index 193bb3260..f16d804b7 100644 --- a/code/Forms/LinkFormFactory.php +++ b/code/Forms/LinkFormFactory.php @@ -27,7 +27,7 @@ abstract class LinkFormFactory implements FormFactory * @param array $context * @return Form */ - public function getForm(RequestHandler $controller = null, $name = FormFactory::DEFAULT_NAME, $context = []) + public function getForm(?RequestHandler $controller = null, $name = FormFactory::DEFAULT_NAME, $context = []) { // Validate context foreach ($this->getRequiredContext() as $required) {