Skip to content

Commit

Permalink
Merge pull request #374 from creative-commoners/pulls/3/php84
Browse files Browse the repository at this point in the history
API Explicity mark nullable parameters for PHP 8.4
  • Loading branch information
GuySartorelli authored Dec 2, 2024
2 parents aac7023 + 86c1aa2 commit 982f094
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Controllers/HistoryViewerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ public function getCompareForm(array $context)
return $form;
}

public function versionForm(HTTPRequest $request = null)
public function versionForm(?HTTPRequest $request = null)
{
if (!$request) {
$this->jsonError(400);
Expand All @@ -373,7 +373,7 @@ public function versionForm(HTTPRequest $request = null)
}
}

public function compareForm(HTTPRequest $request = null)
public function compareForm(?HTTPRequest $request = null)
{
if (!$request) {
$this->jsonError(400);
Expand Down
6 changes: 3 additions & 3 deletions src/Forms/DataObjectVersionFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class DataObjectVersionFormFactory implements FormFactory
DataObjectVersionFormFactory::TYPE_HISTORY,
];

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) {
Expand Down Expand Up @@ -91,7 +91,7 @@ public function isReadonlyFormType(array $context)
return in_array($this->getFormType($context), $this->config()->get('readonly_types') ?? []);
}

protected function getFormFields(RequestHandler $controller = null, $name, $context = [])
protected function getFormFields(?RequestHandler $controller, $name, $context = [])
{
$record = $context['Record'];
/** @var FieldList $fields */
Expand Down Expand Up @@ -157,7 +157,7 @@ protected function removeSelectedRightTitles(FieldList $fields)
}
}

protected function getFormActions(RequestHandler $controller = null, $formName, $context = [])
protected function getFormActions(?RequestHandler $controller, $formName, $context = [])
{
$actions = FieldList::create();
$this->invokeWithExtensions('updateFormActions', $actions, $controller, $formName, $context);
Expand Down

0 comments on commit 982f094

Please sign in to comment.