Skip to content

Commit f21d888

Browse files
phansysfranmomu
authored andcommitted
Configure "nullable_type_declaration_for_default_null_value" CS rule
1 parent 94ef07a commit f21d888

37 files changed

+44
-43
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
'no_superfluous_elseif' => true,
5252
'no_unset_on_property' => true,
5353
'no_useless_else' => true,
54+
'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => true],
5455
'ordered_class_elements' => true,
5556
'ordered_imports' => ['sort_algorithm' => 'alpha'],
5657
'phpdoc_summary' => false,

src/DoctrineExtensions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class DoctrineExtensions
3434
* Hooks all extension metadata mapping drivers into
3535
* the given driver chain of drivers for the ORM.
3636
*/
37-
public static function registerMappingIntoDriverChainORM(MappingDriverChain $driverChain, Reader $reader = null): void
37+
public static function registerMappingIntoDriverChainORM(MappingDriverChain $driverChain, ?Reader $reader = null): void
3838
{
3939
if (!$reader) {
4040
$reader = self::createAnnotationReader();
@@ -51,7 +51,7 @@ public static function registerMappingIntoDriverChainORM(MappingDriverChain $dri
5151
* Hooks only superclass extension metadata mapping drivers into
5252
* the given driver chain of drivers for the ORM.
5353
*/
54-
public static function registerAbstractMappingIntoDriverChainORM(MappingDriverChain $driverChain, Reader $reader = null): void
54+
public static function registerAbstractMappingIntoDriverChainORM(MappingDriverChain $driverChain, ?Reader $reader = null): void
5555
{
5656
if (!$reader) {
5757
$reader = self::createAnnotationReader();
@@ -68,7 +68,7 @@ public static function registerAbstractMappingIntoDriverChainORM(MappingDriverCh
6868
* Hooks all extension metadata mapping drivers into
6969
* the given driver chain of drivers for the MongoDB ODM.
7070
*/
71-
public static function registerMappingIntoDriverChainMongodbODM(MappingDriverChain $driverChain, Reader $reader = null): void
71+
public static function registerMappingIntoDriverChainMongodbODM(MappingDriverChain $driverChain, ?Reader $reader = null): void
7272
{
7373
if (!$reader) {
7474
$reader = self::createAnnotationReader();
@@ -84,7 +84,7 @@ public static function registerMappingIntoDriverChainMongodbODM(MappingDriverCha
8484
* Hooks only superclass extension metadata mapping drivers into
8585
* the given driver chain of drivers for the MongoDB ODM.
8686
*/
87-
public static function registerAbstractMappingIntoDriverChainMongodbODM(MappingDriverChain $driverChain, Reader $reader = null): void
87+
public static function registerAbstractMappingIntoDriverChainMongodbODM(MappingDriverChain $driverChain, ?Reader $reader = null): void
8888
{
8989
if (!$reader) {
9090
$reader = self::createAnnotationReader();

src/SoftDeleteable/Traits/SoftDeleteable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ trait SoftDeleteable
2929
*
3030
* @return self
3131
*/
32-
public function setDeletedAt(DateTime $deletedAt = null)
32+
public function setDeletedAt(?DateTime $deletedAt = null)
3333
{
3434
$this->deletedAt = $deletedAt;
3535

src/SoftDeleteable/Traits/SoftDeleteableDocument.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ trait SoftDeleteableDocument
3434
*
3535
* @return self
3636
*/
37-
public function setDeletedAt(DateTime $deletedAt = null)
37+
public function setDeletedAt(?DateTime $deletedAt = null)
3838
{
3939
$this->deletedAt = $deletedAt;
4040

src/SoftDeleteable/Traits/SoftDeleteableEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ trait SoftDeleteableEntity
3434
*
3535
* @return self
3636
*/
37-
public function setDeletedAt(DateTime $deletedAt = null)
37+
public function setDeletedAt(?DateTime $deletedAt = null)
3838
{
3939
$this->deletedAt = $deletedAt;
4040

src/Tool/Logging/DBAL/QueryAnalyzer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function __construct(AbstractPlatform $platform)
7171
/**
7272
* @return void
7373
*/
74-
public function startQuery($sql, array $params = null, array $types = null)
74+
public function startQuery($sql, ?array $params = null, ?array $types = null)
7575
{
7676
$this->queryStartTime = microtime(true);
7777
$this->queries[] = $this->generateSql($sql, $params, $types);

src/Tree/Traits/MaterializedPath.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ trait MaterializedPath
4545
*
4646
* @return self
4747
*/
48-
public function setParent(self $parent = null)
48+
public function setParent(?self $parent = null)
4949
{
5050
$this->parent = $parent;
5151

src/Uploadable/UploadableListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class UploadableListener extends MappedEventSubscriber
9090
*/
9191
private $fileInfoObjects = [];
9292

93-
public function __construct(MimeTypeGuesserInterface $mimeTypeGuesser = null)
93+
public function __construct(?MimeTypeGuesserInterface $mimeTypeGuesser = null)
9494
{
9595
parent::__construct();
9696

tests/Gedmo/Sluggable/Fixture/Document/Handler/RelativeSlug.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class RelativeSlug
6363
#[ODM\ReferenceOne(targetDocument: Article::class)]
6464
private $article;
6565

66-
public function setArticle(Article $article = null): void
66+
public function setArticle(?Article $article = null): void
6767
{
6868
$this->article = $article;
6969
}

tests/Gedmo/Sluggable/Fixture/Document/Handler/TreeSlug.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class TreeSlug
6262
#[ODM\ReferenceOne(targetDocument: self::class)]
6363
private $parent;
6464

65-
public function setParent(self $parent = null): void
65+
public function setParent(?self $parent = null): void
6666
{
6767
$this->parent = $parent;
6868
}

0 commit comments

Comments
 (0)