Skip to content

Commit

Permalink
API Make parameter non-optional for PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Dec 1, 2024
1 parent 6480a91 commit 715019f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions code/Forms/AssetFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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;

Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions code/Forms/FileFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions code/Forms/FileHistoryFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/Forms/FileSearchFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion code/Forms/FolderCreateFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion code/Forms/FolderFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 715019f

Please sign in to comment.