From 26863f5a269564d159a47f5e2fccd52ca5538c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BCrk?= <stefan@buerk.tech> Date: Tue, 25 Jun 2024 15:17:47 +0200 Subject: [PATCH] [TASK] Avoid implicitly nullable class method parameter in `EXT:rte_ckeditor` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With PHP 8.4 marking method parameter implicitly nullable is deprecated and will emit a `E_DEPRECATED` warning. One recommended way to resolve this, is making it explicitly nullable using the `?` nullable operator. [1] This prepares the way towards PHP 8.4 compatibility. [1] https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated Resolves: #104205 Releases: main, 12.4, 11.5 Change-Id: Iaca12350ce8b28943fd5ce8181d42b91feb471e3 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84905 Tested-by: core-ci <typo3@b13.com> Tested-by: Oliver Klee <typo3-coding@oliverklee.de> Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Tested-by: Stefan Bürk <stefan@buerk.tech> --- .../rte_ckeditor/Classes/Controller/BrowseLinksController.php | 2 +- .../rte_ckeditor/Classes/Form/Element/RichTextElement.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/typo3/sysext/rte_ckeditor/Classes/Controller/BrowseLinksController.php b/typo3/sysext/rte_ckeditor/Classes/Controller/BrowseLinksController.php index 9e9ae44dc9b8..6ed304c70c1d 100644 --- a/typo3/sysext/rte_ckeditor/Classes/Controller/BrowseLinksController.php +++ b/typo3/sysext/rte_ckeditor/Classes/Controller/BrowseLinksController.php @@ -541,7 +541,7 @@ class BrowseLinksController extends AbstractLinkBrowserController * * @return array Array of parameters which have to be added to URLs */ - public function getUrlParameters(array $overrides = null) + public function getUrlParameters(?array $overrides = null) { return [ 'act' => $overrides['act'] ?? $this->displayedLinkHandlerId, diff --git a/typo3/sysext/rte_ckeditor/Classes/Form/Element/RichTextElement.php b/typo3/sysext/rte_ckeditor/Classes/Form/Element/RichTextElement.php index 7b65c2ce944c..7f4634f5f11f 100644 --- a/typo3/sysext/rte_ckeditor/Classes/Form/Element/RichTextElement.php +++ b/typo3/sysext/rte_ckeditor/Classes/Form/Element/RichTextElement.php @@ -91,7 +91,7 @@ class RichTextElement extends AbstractFormElement * @param array $data * @param EventDispatcherInterface|null $eventDispatcher */ - public function __construct(NodeFactory $nodeFactory, array $data, EventDispatcherInterface $eventDispatcher = null) + public function __construct(NodeFactory $nodeFactory, array $data, ?EventDispatcherInterface $eventDispatcher = null) { parent::__construct($nodeFactory, $data); $this->eventDispatcher = $eventDispatcher ?? GeneralUtility::makeInstance(EventDispatcherInterface::class); -- GitLab