Skip to content

Commit

Permalink
API Explicity mark nullable parameters for PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Nov 28, 2024
1 parent aac7023 commit b690f59
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 = null, $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 = null, $formName, $context = [])
{
$actions = FieldList::create();
$this->invokeWithExtensions('updateFormActions', $actions, $controller, $formName, $context);
Expand Down

0 comments on commit b690f59

Please sign in to comment.