From b0ce235b8ea276a9db6c941f96b19a61ea7d4f25 Mon Sep 17 00:00:00 2001 From: Eric Gesemann Date: Tue, 19 Mar 2024 14:36:28 +0100 Subject: [PATCH] dca()->getDcaFields() move constructor call to method body --- src/Util/DcaUtil.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Util/DcaUtil.php b/src/Util/DcaUtil.php index 8c6e900e..ea30b6cb 100644 --- a/src/Util/DcaUtil.php +++ b/src/Util/DcaUtil.php @@ -136,8 +136,12 @@ function ($a) use (&$arrFields) { * Return a list of dca fields for given table. * Fields can be filtered by given options. */ - public function getDcaFields(string $table, GetDcaFieldsOptions $options = new GetDcaFieldsOptions()): array + public function getDcaFields(string $table, ?GetDcaFieldsOptions $options = null): array { + if (null === $options) { + $options = new GetDcaFieldsOptions(); + } + $fields = []; $controller = $this->contaoFramework->getAdapter(Controller::class);