From 4b4028a2ddc0fbb1ce99349656613b7a014cae2f Mon Sep 17 00:00:00 2001
From: Simon Schaufelberger <simonschaufi+typo3@gmail.com>
Date: Mon, 20 Dec 2021 22:57:22 +0100
Subject: [PATCH] [BUGFIX] Fix doctype annotations

According to https://docs.phpdoc.org/latest/guide/guides/types.html#union-types
it is only allowed to use "string|null" and not "?string"

Resolves: #96407
Releases: main, 11.5
Change-Id: I4e9ec53d05feb5cfffc4eebc29de447d6225ab66
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72749
Tested-by: core-ci <typo3@b13.com>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 typo3/sysext/core/Classes/Page/JavaScriptModuleInstruction.php  | 2 +-
 typo3/sysext/core/Tests/Unit/Package/MetaDataTest.php           | 2 +-
 .../extbase/Classes/Persistence/Generic/LazyLoadingProxy.php    | 2 +-
 .../extbase/Classes/Persistence/Generic/LazyObjectStorage.php   | 2 +-
 typo3/sysext/extbase/Classes/Persistence/Generic/Query.php      | 2 +-
 .../Extensions/blog_example/Classes/Domain/Model/Blog.php       | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/typo3/sysext/core/Classes/Page/JavaScriptModuleInstruction.php b/typo3/sysext/core/Classes/Page/JavaScriptModuleInstruction.php
index cde9a4ec7232..f4a4a96567d6 100644
--- a/typo3/sysext/core/Classes/Page/JavaScriptModuleInstruction.php
+++ b/typo3/sysext/core/Classes/Page/JavaScriptModuleInstruction.php
@@ -42,7 +42,7 @@ class JavaScriptModuleInstruction implements \JsonSerializable
 
     /**
      * @param string $name RequireJS module name
-     * @param ?string $exportName (optional) name used internally to export the module
+     * @param string|null $exportName (optional) name used internally to export the module
      * @return static
      */
     public static function forRequireJS(string $name, string $exportName = null): self
diff --git a/typo3/sysext/core/Tests/Unit/Package/MetaDataTest.php b/typo3/sysext/core/Tests/Unit/Package/MetaDataTest.php
index 67a3f119b367..ea632f9b5130 100644
--- a/typo3/sysext/core/Tests/Unit/Package/MetaDataTest.php
+++ b/typo3/sysext/core/Tests/Unit/Package/MetaDataTest.php
@@ -50,7 +50,7 @@ class MetaDataTest extends UnitTestCase
     }
 
     /**
-     * @param ?string $type
+     * @param string|null $type
      * @param bool $isExtension
      * @param bool $isFramework
      * @test
diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/LazyLoadingProxy.php b/typo3/sysext/extbase/Classes/Persistence/Generic/LazyLoadingProxy.php
index abc7d7ccdda9..b8415822cff5 100644
--- a/typo3/sysext/extbase/Classes/Persistence/Generic/LazyLoadingProxy.php
+++ b/typo3/sysext/extbase/Classes/Persistence/Generic/LazyLoadingProxy.php
@@ -56,7 +56,7 @@ class LazyLoadingProxy implements \Iterator, LoadingStrategyInterface
      * @param DomainObjectInterface $parentObject The object instance this proxy is part of
      * @param string $propertyName The name of the proxied property in it's parent
      * @param mixed $fieldValue The raw field value.
-     * @param ?DataMapper $dataMapper
+     * @param DataMapper|null $dataMapper
      */
     public function __construct($parentObject, $propertyName, $fieldValue, ?DataMapper $dataMapper = null)
     {
diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/LazyObjectStorage.php b/typo3/sysext/extbase/Classes/Persistence/Generic/LazyObjectStorage.php
index 08ede3a38552..716a9f4946db 100644
--- a/typo3/sysext/extbase/Classes/Persistence/Generic/LazyObjectStorage.php
+++ b/typo3/sysext/extbase/Classes/Persistence/Generic/LazyObjectStorage.php
@@ -84,7 +84,7 @@ class LazyObjectStorage extends ObjectStorage implements LoadingStrategyInterfac
      * @param TEntity $parentObject The object instance this proxy is part of
      * @param string $propertyName The name of the proxied property in it's parent
      * @param mixed $fieldValue The raw field value.
-     * @param ?DataMapper $dataMapper
+     * @param DataMapper|null $dataMapper
      */
     public function __construct($parentObject, $propertyName, $fieldValue, ?DataMapper $dataMapper = null)
     {
diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Query.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Query.php
index 46d3ac0a83a9..e20b29529ca0 100644
--- a/typo3/sysext/extbase/Classes/Persistence/Generic/Query.php
+++ b/typo3/sysext/extbase/Classes/Persistence/Generic/Query.php
@@ -137,7 +137,7 @@ class Query implements QueryInterface
     }
 
     /**
-     * @param ?QueryInterface $parentQuery
+     * @param QueryInterface|null $parentQuery
      * @internal
      */
     public function setParentQuery(?QueryInterface $parentQuery): void
diff --git a/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Domain/Model/Blog.php b/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Domain/Model/Blog.php
index 5b4d27a1c145..206b7e31dad3 100644
--- a/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Domain/Model/Blog.php
+++ b/typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Domain/Model/Blog.php
@@ -251,7 +251,7 @@ class Blog extends AbstractEntity
     }
 
     /**
-     * @param ?string $subtitle
+     * @param string|null $subtitle
      */
     public function setSubtitle($subtitle): void
     {
-- 
GitLab