From f21d8880246c6df18aa00dae2075349310390386 Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Mon, 24 Jul 2023 22:23:28 -0300 Subject: [PATCH] Configure "nullable_type_declaration_for_default_null_value" CS rule --- .php-cs-fixer.dist.php | 1 + src/DoctrineExtensions.php | 8 ++++---- src/SoftDeleteable/Traits/SoftDeleteable.php | 2 +- src/SoftDeleteable/Traits/SoftDeleteableDocument.php | 2 +- src/SoftDeleteable/Traits/SoftDeleteableEntity.php | 2 +- src/Tool/Logging/DBAL/QueryAnalyzer.php | 2 +- src/Tree/Traits/MaterializedPath.php | 2 +- src/Uploadable/UploadableListener.php | 2 +- .../Sluggable/Fixture/Document/Handler/RelativeSlug.php | 2 +- .../Gedmo/Sluggable/Fixture/Document/Handler/TreeSlug.php | 2 +- .../Sluggable/Fixture/Handler/ArticleRelativeSlug.php | 2 +- .../Gedmo/Sluggable/Fixture/Handler/People/Occupation.php | 2 +- tests/Gedmo/Sluggable/Fixture/Handler/People/Person.php | 2 +- tests/Gedmo/Sluggable/Fixture/Handler/TreeSlug.php | 2 +- .../Sluggable/Fixture/Handler/TreeSlugPrefixSuffix.php | 2 +- tests/Gedmo/Sluggable/Fixture/Handler/User.php | 2 +- tests/Gedmo/Sortable/Fixture/Item.php | 2 +- tests/Gedmo/Tool/BaseTestCaseMongoODM.php | 4 ++-- tests/Gedmo/Tool/BaseTestCaseOM.php | 8 ++++---- tests/Gedmo/Tool/BaseTestCaseORM.php | 2 +- tests/Gedmo/Tool/QueryAnalyzer.php | 2 +- tests/Gedmo/Translator/Fixture/PersonCustom.php | 2 +- tests/Gedmo/Tree/Fixture/ANode.php | 2 +- tests/Gedmo/Tree/Fixture/Closure/Category.php | 2 +- tests/Gedmo/Tree/Fixture/Closure/CategoryWithoutLevel.php | 2 +- tests/Gedmo/Tree/Fixture/Closure/Person.php | 2 +- tests/Gedmo/Tree/Fixture/Document/Article.php | 2 +- tests/Gedmo/Tree/Fixture/Document/Category.php | 2 +- tests/Gedmo/Tree/Fixture/ForeignRootCategory.php | 2 +- tests/Gedmo/Tree/Fixture/Issue2408/Category.php | 2 +- tests/Gedmo/Tree/Fixture/MPCategory.php | 2 +- .../Gedmo/Tree/Fixture/MPCategoryWithRootAssociation.php | 2 +- .../Gedmo/Tree/Fixture/MPCategoryWithTrimmedSeparator.php | 2 +- tests/Gedmo/Tree/Fixture/MPFeaturesCategory.php | 2 +- tests/Gedmo/Tree/Fixture/RootAssociationCategory.php | 2 +- tests/Gedmo/Tree/Fixture/RootCategory.php | 2 +- tests/Gedmo/Tree/MaterializedPathORMRepositoryTest.php | 2 +- 37 files changed, 44 insertions(+), 43 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 9db45f981c..3d04e01813 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -51,6 +51,7 @@ 'no_superfluous_elseif' => true, 'no_unset_on_property' => true, 'no_useless_else' => true, + 'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => true], 'ordered_class_elements' => true, 'ordered_imports' => ['sort_algorithm' => 'alpha'], 'phpdoc_summary' => false, diff --git a/src/DoctrineExtensions.php b/src/DoctrineExtensions.php index c3548675a6..437de34fe1 100644 --- a/src/DoctrineExtensions.php +++ b/src/DoctrineExtensions.php @@ -34,7 +34,7 @@ final class DoctrineExtensions * Hooks all extension metadata mapping drivers into * the given driver chain of drivers for the ORM. */ - public static function registerMappingIntoDriverChainORM(MappingDriverChain $driverChain, Reader $reader = null): void + public static function registerMappingIntoDriverChainORM(MappingDriverChain $driverChain, ?Reader $reader = null): void { if (!$reader) { $reader = self::createAnnotationReader(); @@ -51,7 +51,7 @@ public static function registerMappingIntoDriverChainORM(MappingDriverChain $dri * Hooks only superclass extension metadata mapping drivers into * the given driver chain of drivers for the ORM. */ - public static function registerAbstractMappingIntoDriverChainORM(MappingDriverChain $driverChain, Reader $reader = null): void + public static function registerAbstractMappingIntoDriverChainORM(MappingDriverChain $driverChain, ?Reader $reader = null): void { if (!$reader) { $reader = self::createAnnotationReader(); @@ -68,7 +68,7 @@ public static function registerAbstractMappingIntoDriverChainORM(MappingDriverCh * Hooks all extension metadata mapping drivers into * the given driver chain of drivers for the MongoDB ODM. */ - public static function registerMappingIntoDriverChainMongodbODM(MappingDriverChain $driverChain, Reader $reader = null): void + public static function registerMappingIntoDriverChainMongodbODM(MappingDriverChain $driverChain, ?Reader $reader = null): void { if (!$reader) { $reader = self::createAnnotationReader(); @@ -84,7 +84,7 @@ public static function registerMappingIntoDriverChainMongodbODM(MappingDriverCha * Hooks only superclass extension metadata mapping drivers into * the given driver chain of drivers for the MongoDB ODM. */ - public static function registerAbstractMappingIntoDriverChainMongodbODM(MappingDriverChain $driverChain, Reader $reader = null): void + public static function registerAbstractMappingIntoDriverChainMongodbODM(MappingDriverChain $driverChain, ?Reader $reader = null): void { if (!$reader) { $reader = self::createAnnotationReader(); diff --git a/src/SoftDeleteable/Traits/SoftDeleteable.php b/src/SoftDeleteable/Traits/SoftDeleteable.php index 1b2014b434..1850005906 100644 --- a/src/SoftDeleteable/Traits/SoftDeleteable.php +++ b/src/SoftDeleteable/Traits/SoftDeleteable.php @@ -29,7 +29,7 @@ trait SoftDeleteable * * @return self */ - public function setDeletedAt(DateTime $deletedAt = null) + public function setDeletedAt(?DateTime $deletedAt = null) { $this->deletedAt = $deletedAt; diff --git a/src/SoftDeleteable/Traits/SoftDeleteableDocument.php b/src/SoftDeleteable/Traits/SoftDeleteableDocument.php index 3dc5af5396..9f18ba826a 100644 --- a/src/SoftDeleteable/Traits/SoftDeleteableDocument.php +++ b/src/SoftDeleteable/Traits/SoftDeleteableDocument.php @@ -34,7 +34,7 @@ trait SoftDeleteableDocument * * @return self */ - public function setDeletedAt(DateTime $deletedAt = null) + public function setDeletedAt(?DateTime $deletedAt = null) { $this->deletedAt = $deletedAt; diff --git a/src/SoftDeleteable/Traits/SoftDeleteableEntity.php b/src/SoftDeleteable/Traits/SoftDeleteableEntity.php index 4221351c74..dfa3903006 100644 --- a/src/SoftDeleteable/Traits/SoftDeleteableEntity.php +++ b/src/SoftDeleteable/Traits/SoftDeleteableEntity.php @@ -34,7 +34,7 @@ trait SoftDeleteableEntity * * @return self */ - public function setDeletedAt(DateTime $deletedAt = null) + public function setDeletedAt(?DateTime $deletedAt = null) { $this->deletedAt = $deletedAt; diff --git a/src/Tool/Logging/DBAL/QueryAnalyzer.php b/src/Tool/Logging/DBAL/QueryAnalyzer.php index b1f0b9288c..4178779024 100644 --- a/src/Tool/Logging/DBAL/QueryAnalyzer.php +++ b/src/Tool/Logging/DBAL/QueryAnalyzer.php @@ -71,7 +71,7 @@ public function __construct(AbstractPlatform $platform) /** * @return void */ - public function startQuery($sql, array $params = null, array $types = null) + public function startQuery($sql, ?array $params = null, ?array $types = null) { $this->queryStartTime = microtime(true); $this->queries[] = $this->generateSql($sql, $params, $types); diff --git a/src/Tree/Traits/MaterializedPath.php b/src/Tree/Traits/MaterializedPath.php index bb0aadf4c8..f9a48dca59 100644 --- a/src/Tree/Traits/MaterializedPath.php +++ b/src/Tree/Traits/MaterializedPath.php @@ -45,7 +45,7 @@ trait MaterializedPath * * @return self */ - public function setParent(self $parent = null) + public function setParent(?self $parent = null) { $this->parent = $parent; diff --git a/src/Uploadable/UploadableListener.php b/src/Uploadable/UploadableListener.php index 82314642e7..bd46a50694 100644 --- a/src/Uploadable/UploadableListener.php +++ b/src/Uploadable/UploadableListener.php @@ -90,7 +90,7 @@ class UploadableListener extends MappedEventSubscriber */ private $fileInfoObjects = []; - public function __construct(MimeTypeGuesserInterface $mimeTypeGuesser = null) + public function __construct(?MimeTypeGuesserInterface $mimeTypeGuesser = null) { parent::__construct(); diff --git a/tests/Gedmo/Sluggable/Fixture/Document/Handler/RelativeSlug.php b/tests/Gedmo/Sluggable/Fixture/Document/Handler/RelativeSlug.php index 0c64b1347a..cecd3549f2 100644 --- a/tests/Gedmo/Sluggable/Fixture/Document/Handler/RelativeSlug.php +++ b/tests/Gedmo/Sluggable/Fixture/Document/Handler/RelativeSlug.php @@ -63,7 +63,7 @@ class RelativeSlug #[ODM\ReferenceOne(targetDocument: Article::class)] private $article; - public function setArticle(Article $article = null): void + public function setArticle(?Article $article = null): void { $this->article = $article; } diff --git a/tests/Gedmo/Sluggable/Fixture/Document/Handler/TreeSlug.php b/tests/Gedmo/Sluggable/Fixture/Document/Handler/TreeSlug.php index 06e79efae9..c8984cb2aa 100644 --- a/tests/Gedmo/Sluggable/Fixture/Document/Handler/TreeSlug.php +++ b/tests/Gedmo/Sluggable/Fixture/Document/Handler/TreeSlug.php @@ -62,7 +62,7 @@ class TreeSlug #[ODM\ReferenceOne(targetDocument: self::class)] private $parent; - public function setParent(self $parent = null): void + public function setParent(?self $parent = null): void { $this->parent = $parent; } diff --git a/tests/Gedmo/Sluggable/Fixture/Handler/ArticleRelativeSlug.php b/tests/Gedmo/Sluggable/Fixture/Handler/ArticleRelativeSlug.php index 646227a5bf..82253d31da 100644 --- a/tests/Gedmo/Sluggable/Fixture/Handler/ArticleRelativeSlug.php +++ b/tests/Gedmo/Sluggable/Fixture/Handler/ArticleRelativeSlug.php @@ -67,7 +67,7 @@ class ArticleRelativeSlug #[ORM\ManyToOne(targetEntity: Article::class)] private $article; - public function setArticle(Article $article = null): void + public function setArticle(?Article $article = null): void { $this->article = $article; } diff --git a/tests/Gedmo/Sluggable/Fixture/Handler/People/Occupation.php b/tests/Gedmo/Sluggable/Fixture/Handler/People/Occupation.php index 946bd47177..6acf3ce287 100644 --- a/tests/Gedmo/Sluggable/Fixture/Handler/People/Occupation.php +++ b/tests/Gedmo/Sluggable/Fixture/Handler/People/Occupation.php @@ -132,7 +132,7 @@ public function __construct() $this->children = new ArrayCollection(); } - public function setParent(self $parent = null): void + public function setParent(?self $parent = null): void { $this->parent = $parent; } diff --git a/tests/Gedmo/Sluggable/Fixture/Handler/People/Person.php b/tests/Gedmo/Sluggable/Fixture/Handler/People/Person.php index 2963056326..34b5e0c8a5 100644 --- a/tests/Gedmo/Sluggable/Fixture/Handler/People/Person.php +++ b/tests/Gedmo/Sluggable/Fixture/Handler/People/Person.php @@ -67,7 +67,7 @@ class Person #[ORM\ManyToOne(targetEntity: Occupation::class)] private $occupation; - public function setOccupation(Occupation $occupation = null): void + public function setOccupation(?Occupation $occupation = null): void { $this->occupation = $occupation; } diff --git a/tests/Gedmo/Sluggable/Fixture/Handler/TreeSlug.php b/tests/Gedmo/Sluggable/Fixture/Handler/TreeSlug.php index 511e7d04cb..70fcb0b7d0 100644 --- a/tests/Gedmo/Sluggable/Fixture/Handler/TreeSlug.php +++ b/tests/Gedmo/Sluggable/Fixture/Handler/TreeSlug.php @@ -131,7 +131,7 @@ public function __construct() $this->children = new ArrayCollection(); } - public function setParent(self $parent = null): void + public function setParent(?self $parent = null): void { $this->parent = $parent; } diff --git a/tests/Gedmo/Sluggable/Fixture/Handler/TreeSlugPrefixSuffix.php b/tests/Gedmo/Sluggable/Fixture/Handler/TreeSlugPrefixSuffix.php index 57ce68f61a..09130b9c0e 100644 --- a/tests/Gedmo/Sluggable/Fixture/Handler/TreeSlugPrefixSuffix.php +++ b/tests/Gedmo/Sluggable/Fixture/Handler/TreeSlugPrefixSuffix.php @@ -127,7 +127,7 @@ public function __construct() $this->children = new ArrayCollection(); } - public function setParent(self $parent = null): void + public function setParent(?self $parent = null): void { $this->parent = $parent; } diff --git a/tests/Gedmo/Sluggable/Fixture/Handler/User.php b/tests/Gedmo/Sluggable/Fixture/Handler/User.php index 2c29225f1d..52f198de74 100644 --- a/tests/Gedmo/Sluggable/Fixture/Handler/User.php +++ b/tests/Gedmo/Sluggable/Fixture/Handler/User.php @@ -67,7 +67,7 @@ class User #[ORM\ManyToOne(targetEntity: Company::class)] private $company; - public function setCompany(Company $company = null): void + public function setCompany(?Company $company = null): void { $this->company = $company; } diff --git a/tests/Gedmo/Sortable/Fixture/Item.php b/tests/Gedmo/Sortable/Fixture/Item.php index 5ecb6a97ba..f711cabb4e 100644 --- a/tests/Gedmo/Sortable/Fixture/Item.php +++ b/tests/Gedmo/Sortable/Fixture/Item.php @@ -87,7 +87,7 @@ public function getPosition(): ?int return $this->position; } - public function setCategory(Category $category = null): void + public function setCategory(?Category $category = null): void { $this->category = $category; } diff --git a/tests/Gedmo/Tool/BaseTestCaseMongoODM.php b/tests/Gedmo/Tool/BaseTestCaseMongoODM.php index 7a9701cc65..56e5db439d 100644 --- a/tests/Gedmo/Tool/BaseTestCaseMongoODM.php +++ b/tests/Gedmo/Tool/BaseTestCaseMongoODM.php @@ -74,7 +74,7 @@ protected function getMockDocumentManager(?EventManager $evm = null, ?Configurat return $this->dm = DocumentManager::create($client, $config, $evm); } - protected function getDefaultDocumentManager(EventManager $evm = null): DocumentManager + protected function getDefaultDocumentManager(?EventManager $evm = null): DocumentManager { return $this->getMockDocumentManager($evm, $this->getDefaultConfiguration()); } @@ -83,7 +83,7 @@ protected function getDefaultDocumentManager(EventManager $evm = null): Document * DocumentManager mock object with * annotation mapping driver */ - protected function getMockMappedDocumentManager(EventManager $evm = null, Configuration $config = null): DocumentManager + protected function getMockMappedDocumentManager(?EventManager $evm = null, ?Configuration $config = null): DocumentManager { $conn = $this->createStub(Client::class); diff --git a/tests/Gedmo/Tool/BaseTestCaseOM.php b/tests/Gedmo/Tool/BaseTestCaseOM.php index 3d411d91ac..c702b8816c 100644 --- a/tests/Gedmo/Tool/BaseTestCaseOM.php +++ b/tests/Gedmo/Tool/BaseTestCaseOM.php @@ -93,7 +93,7 @@ public function getORMDriver(array $paths = []): MappingDriver * DocumentManager mock object together with * annotation mapping driver and database */ - protected function getMockDocumentManager(string $dbName, MappingDriver $mappingDriver = null): DocumentManager + protected function getMockDocumentManager(string $dbName, ?MappingDriver $mappingDriver = null): DocumentManager { if (!extension_loaded('mongodb')) { static::markTestSkipped('Missing Mongo extension.'); @@ -110,7 +110,7 @@ protected function getMockDocumentManager(string $dbName, MappingDriver $mapping * annotation mapping driver and pdo_sqlite * database in memory */ - protected function getDefaultMockSqliteEntityManager(array $fixtures, MappingDriver $mappingDriver = null): EntityManager + protected function getDefaultMockSqliteEntityManager(array $fixtures, ?MappingDriver $mappingDriver = null): EntityManager { $conn = [ 'driver' => 'pdo_sqlite', @@ -153,7 +153,7 @@ private function getEventManager(): EventManager /** * Get annotation mapping configuration */ - private function getMockODMMongoDBConfig(string $dbName, MappingDriver $mappingDriver = null): Configuration + private function getMockODMMongoDBConfig(string $dbName, ?MappingDriver $mappingDriver = null): Configuration { if (null === $mappingDriver) { $mappingDriver = $this->getMongoDBDriver(); @@ -176,7 +176,7 @@ private function getMockODMMongoDBConfig(string $dbName, MappingDriver $mappingD /** * Get annotation mapping configuration for ORM */ - private function getMockORMConfig(MappingDriver $mappingDriver = null): \Doctrine\ORM\Configuration + private function getMockORMConfig(?MappingDriver $mappingDriver = null): \Doctrine\ORM\Configuration { $config = new \Doctrine\ORM\Configuration(); $config->setProxyDir(TESTS_TEMP_DIR); diff --git a/tests/Gedmo/Tool/BaseTestCaseORM.php b/tests/Gedmo/Tool/BaseTestCaseORM.php index af33e2a138..1cea88094c 100644 --- a/tests/Gedmo/Tool/BaseTestCaseORM.php +++ b/tests/Gedmo/Tool/BaseTestCaseORM.php @@ -65,7 +65,7 @@ protected function setUp(): void * annotation mapping driver and pdo_sqlite * database in memory */ - protected function getDefaultMockSqliteEntityManager(EventManager $evm = null, Configuration $config = null): EntityManager + protected function getDefaultMockSqliteEntityManager(?EventManager $evm = null, ?Configuration $config = null): EntityManager { $conn = [ 'driver' => 'pdo_sqlite', diff --git a/tests/Gedmo/Tool/QueryAnalyzer.php b/tests/Gedmo/Tool/QueryAnalyzer.php index b3c4e07cab..19bcd5958e 100644 --- a/tests/Gedmo/Tool/QueryAnalyzer.php +++ b/tests/Gedmo/Tool/QueryAnalyzer.php @@ -39,7 +39,7 @@ public function __construct(AbstractPlatform $platform) $this->platform = $platform; } - public function startQuery($sql, array $params = null, array $types = null): void + public function startQuery($sql, ?array $params = null, ?array $types = null): void { $this->queries[] = $this->generateSql($sql, $params, $types); } diff --git a/tests/Gedmo/Translator/Fixture/PersonCustom.php b/tests/Gedmo/Translator/Fixture/PersonCustom.php index a7dfcb57b4..4191e1186f 100644 --- a/tests/Gedmo/Translator/Fixture/PersonCustom.php +++ b/tests/Gedmo/Translator/Fixture/PersonCustom.php @@ -92,7 +92,7 @@ public function getDescription(): ?string /** * @return self|CustomProxy */ - public function translate(string $locale = null) + public function translate(?string $locale = null) { if (null === $locale) { return $this; diff --git a/tests/Gedmo/Tree/Fixture/ANode.php b/tests/Gedmo/Tree/Fixture/ANode.php index 7008a1d21c..06fa79e174 100644 --- a/tests/Gedmo/Tree/Fixture/ANode.php +++ b/tests/Gedmo/Tree/Fixture/ANode.php @@ -70,7 +70,7 @@ public function getId(): ?int return $this->id; } - public function setParent(BaseNode $parent = null): void + public function setParent(?BaseNode $parent = null): void { $this->parent = $parent; } diff --git a/tests/Gedmo/Tree/Fixture/Closure/Category.php b/tests/Gedmo/Tree/Fixture/Closure/Category.php index 2008edc70e..8b189b7ca3 100644 --- a/tests/Gedmo/Tree/Fixture/Closure/Category.php +++ b/tests/Gedmo/Tree/Fixture/Closure/Category.php @@ -95,7 +95,7 @@ public function getTitle(): ?string return $this->title; } - public function setParent(self $parent = null): void + public function setParent(?self $parent = null): void { $this->parent = $parent; } diff --git a/tests/Gedmo/Tree/Fixture/Closure/CategoryWithoutLevel.php b/tests/Gedmo/Tree/Fixture/Closure/CategoryWithoutLevel.php index e49499ecc8..ae0ab4e6d5 100644 --- a/tests/Gedmo/Tree/Fixture/Closure/CategoryWithoutLevel.php +++ b/tests/Gedmo/Tree/Fixture/Closure/CategoryWithoutLevel.php @@ -85,7 +85,7 @@ public function getTitle(): ?string return $this->title; } - public function setParent(self $parent = null): void + public function setParent(?self $parent = null): void { $this->parent = $parent; } diff --git a/tests/Gedmo/Tree/Fixture/Closure/Person.php b/tests/Gedmo/Tree/Fixture/Closure/Person.php index d10318ea17..01880d9cb1 100644 --- a/tests/Gedmo/Tree/Fixture/Closure/Person.php +++ b/tests/Gedmo/Tree/Fixture/Closure/Person.php @@ -101,7 +101,7 @@ public function getName(): ?string return $this->name; } - public function setParent(self $parent = null): void + public function setParent(?self $parent = null): void { $this->parent = $parent; } diff --git a/tests/Gedmo/Tree/Fixture/Document/Article.php b/tests/Gedmo/Tree/Fixture/Document/Article.php index 06e13e488c..093df31d25 100644 --- a/tests/Gedmo/Tree/Fixture/Document/Article.php +++ b/tests/Gedmo/Tree/Fixture/Document/Article.php @@ -97,7 +97,7 @@ public function getTitle(): ?string return $this->title; } - public function setParent(self $parent = null): void + public function setParent(?self $parent = null): void { $this->parent = $parent; } diff --git a/tests/Gedmo/Tree/Fixture/Document/Category.php b/tests/Gedmo/Tree/Fixture/Document/Category.php index 1a1acff2a6..30b113ac4a 100644 --- a/tests/Gedmo/Tree/Fixture/Document/Category.php +++ b/tests/Gedmo/Tree/Fixture/Document/Category.php @@ -87,7 +87,7 @@ public function getTitle(): ?string return $this->title; } - public function setParent(self $parent = null): void + public function setParent(?self $parent = null): void { $this->parent = $parent; } diff --git a/tests/Gedmo/Tree/Fixture/ForeignRootCategory.php b/tests/Gedmo/Tree/Fixture/ForeignRootCategory.php index aeda7459fb..e61f3dd169 100644 --- a/tests/Gedmo/Tree/Fixture/ForeignRootCategory.php +++ b/tests/Gedmo/Tree/Fixture/ForeignRootCategory.php @@ -128,7 +128,7 @@ public function getTitle(): ?string return $this->title; } - public function setParent(self $parent = null): void + public function setParent(?self $parent = null): void { $this->parent = $parent; } diff --git a/tests/Gedmo/Tree/Fixture/Issue2408/Category.php b/tests/Gedmo/Tree/Fixture/Issue2408/Category.php index 78d488b049..081802c283 100644 --- a/tests/Gedmo/Tree/Fixture/Issue2408/Category.php +++ b/tests/Gedmo/Tree/Fixture/Issue2408/Category.php @@ -131,7 +131,7 @@ public function getRoot(): ?self return $this->root; } - public function setParent(self $parent = null): void + public function setParent(?self $parent = null): void { $this->parent = $parent; } diff --git a/tests/Gedmo/Tree/Fixture/MPCategory.php b/tests/Gedmo/Tree/Fixture/MPCategory.php index 9d6016677b..43a79888b5 100644 --- a/tests/Gedmo/Tree/Fixture/MPCategory.php +++ b/tests/Gedmo/Tree/Fixture/MPCategory.php @@ -129,7 +129,7 @@ public function getTitle(): ?string return $this->title; } - public function setParent(self $parent = null): void + public function setParent(?self $parent = null): void { $this->parentId = $parent; } diff --git a/tests/Gedmo/Tree/Fixture/MPCategoryWithRootAssociation.php b/tests/Gedmo/Tree/Fixture/MPCategoryWithRootAssociation.php index 2ddc5ac458..884797fca0 100644 --- a/tests/Gedmo/Tree/Fixture/MPCategoryWithRootAssociation.php +++ b/tests/Gedmo/Tree/Fixture/MPCategoryWithRootAssociation.php @@ -133,7 +133,7 @@ public function getTitle(): ?string return $this->title; } - public function setParent(self $parent = null): void + public function setParent(?self $parent = null): void { $this->parentId = $parent; } diff --git a/tests/Gedmo/Tree/Fixture/MPCategoryWithTrimmedSeparator.php b/tests/Gedmo/Tree/Fixture/MPCategoryWithTrimmedSeparator.php index 490a9f4355..f52beb9c94 100644 --- a/tests/Gedmo/Tree/Fixture/MPCategoryWithTrimmedSeparator.php +++ b/tests/Gedmo/Tree/Fixture/MPCategoryWithTrimmedSeparator.php @@ -110,7 +110,7 @@ public function getTitle(): ?string return $this->title; } - public function setParent(self $parent = null): void + public function setParent(?self $parent = null): void { $this->parentId = $parent; } diff --git a/tests/Gedmo/Tree/Fixture/MPFeaturesCategory.php b/tests/Gedmo/Tree/Fixture/MPFeaturesCategory.php index a43ca02dde..5c29b158f4 100644 --- a/tests/Gedmo/Tree/Fixture/MPFeaturesCategory.php +++ b/tests/Gedmo/Tree/Fixture/MPFeaturesCategory.php @@ -139,7 +139,7 @@ public function getTitle(): ?string return $this->title; } - public function setParent(self $parent = null): void + public function setParent(?self $parent = null): void { $this->parentId = $parent; } diff --git a/tests/Gedmo/Tree/Fixture/RootAssociationCategory.php b/tests/Gedmo/Tree/Fixture/RootAssociationCategory.php index e6400f64ef..42ed355bd7 100644 --- a/tests/Gedmo/Tree/Fixture/RootAssociationCategory.php +++ b/tests/Gedmo/Tree/Fixture/RootAssociationCategory.php @@ -125,7 +125,7 @@ public function getTitle(): ?string return $this->title; } - public function setParent(self $parent = null): void + public function setParent(?self $parent = null): void { $this->parent = $parent; } diff --git a/tests/Gedmo/Tree/Fixture/RootCategory.php b/tests/Gedmo/Tree/Fixture/RootCategory.php index 92d21b283a..75cf825f6f 100644 --- a/tests/Gedmo/Tree/Fixture/RootCategory.php +++ b/tests/Gedmo/Tree/Fixture/RootCategory.php @@ -127,7 +127,7 @@ public function getTitle(): ?string return $this->title; } - public function setParent(self $parent = null): void + public function setParent(?self $parent = null): void { $this->parent = $parent; } diff --git a/tests/Gedmo/Tree/MaterializedPathORMRepositoryTest.php b/tests/Gedmo/Tree/MaterializedPathORMRepositoryTest.php index a6621768bf..393cc054f9 100644 --- a/tests/Gedmo/Tree/MaterializedPathORMRepositoryTest.php +++ b/tests/Gedmo/Tree/MaterializedPathORMRepositoryTest.php @@ -388,7 +388,7 @@ protected function getUsedEntityFixtures(): array /** * @phpstan-param class-string|null $class */ - private function populate(string $class = null): void + private function populate(?string $class = null): void { $root = $this->createCategory($class); $root->setTitle('Food');