Skip to content

Commit 2a31f2d

Browse files
minor symfony#53612 Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value (nicolas-grekas)
This PR was squashed before being merged into the 5.4 branch. Discussion ---------- Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? |no | Deprecations? |no | Issues | - | License | MIT This one is important to make on 5.4 because it will likely fix a deprecation in a future PHP version, see https://externals.io/message/122214 (do not squash while merging) Commits ------- fb9fa26 Fix implicitly-required parameters 6fec735 List CS fix in .git-blame-ignore-revs f4118e1 Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
2 parents 09cc9c7 + fb9fa26 commit 2a31f2d

File tree

1,244 files changed

+1990
-1987
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,244 files changed

+1990
-1987
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
2+
f4118e110a46de3ffb799e7d79bf15128d1646ea

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
'@Symfony:risky' => true,
3131
'protected_to_private' => false,
3232
'native_constant_invocation' => ['strict' => false],
33+
'nullable_type_declaration_for_default_null_value' => true,
3334
'header_comment' => ['header' => $fileHeaderComment],
3435
])
3536
->setRiskyAllowed(true)

src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct(ContainerInterface $container, array $subscriberIds
5050
*
5151
* @return void
5252
*/
53-
public function dispatchEvent($eventName, EventArgs $eventArgs = null)
53+
public function dispatchEvent($eventName, ?EventArgs $eventArgs = null)
5454
{
5555
if (!$this->initializedSubscribers) {
5656
$this->initializeSubscribers();

src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class DoctrineDataCollector extends DataCollector
3939
*/
4040
private $loggers = [];
4141

42-
public function __construct(ManagerRegistry $registry, DebugDataHolder $debugDataHolder = null)
42+
public function __construct(ManagerRegistry $registry, ?DebugDataHolder $debugDataHolder = null)
4343
{
4444
$this->registry = $registry;
4545
$this->connections = $registry->getConnectionNames();
@@ -58,7 +58,7 @@ public function addLogger(string $name, DebugStack $logger)
5858
/**
5959
* {@inheritdoc}
6060
*/
61-
public function collect(Request $request, Response $response, \Throwable $exception = null)
61+
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
6262
{
6363
$this->data = [
6464
'queries' => $this->collectQueries(),

src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class DoctrineChoiceLoader extends AbstractChoiceLoader
3535
*
3636
* @param string $class The class name of the loaded objects
3737
*/
38-
public function __construct(ObjectManager $manager, string $class, IdReader $idReader = null, EntityLoaderInterface $objectLoader = null)
38+
public function __construct(ObjectManager $manager, string $class, ?IdReader $idReader = null, ?EntityLoaderInterface $objectLoader = null)
3939
{
4040
$classMetadata = $manager->getClassMetadata($class);
4141

src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function isIntId(): bool
7878
*
7979
* This method assumes that the object has a single-column ID.
8080
*/
81-
public function getIdValue(object $object = null): string
81+
public function getIdValue(?object $object = null): string
8282
{
8383
if (!$object) {
8484
return '';

src/Symfony/Bridge/Doctrine/IdGenerator/UlidGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class UlidGenerator extends AbstractIdGenerator
2121
{
2222
private $factory;
2323

24-
public function __construct(UlidFactory $factory = null)
24+
public function __construct(?UlidFactory $factory = null)
2525
{
2626
$this->factory = $factory;
2727
}

src/Symfony/Bridge/Doctrine/IdGenerator/UuidGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class UuidGenerator extends AbstractIdGenerator
2323
private $factory;
2424
private $entityGetter;
2525

26-
public function __construct(UuidFactory $factory = null)
26+
public function __construct(?UuidFactory $factory = null)
2727
{
2828
$this->protoFactory = $this->factory = $factory ?? new UuidFactory();
2929
}

src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class DbalLogger implements SQLLogger
2626
protected $logger;
2727
protected $stopwatch;
2828

29-
public function __construct(LoggerInterface $logger = null, Stopwatch $stopwatch = null)
29+
public function __construct(?LoggerInterface $logger = null, ?Stopwatch $stopwatch = null)
3030
{
3131
$this->logger = $logger;
3232
$this->stopwatch = $stopwatch;
@@ -37,7 +37,7 @@ public function __construct(LoggerInterface $logger = null, Stopwatch $stopwatch
3737
*
3838
* @return void
3939
*/
40-
public function startQuery($sql, array $params = null, array $types = null)
40+
public function startQuery($sql, ?array $params = null, ?array $types = null)
4141
{
4242
if (null !== $this->stopwatch) {
4343
$this->stopwatch->start('doctrine', 'doctrine');

src/Symfony/Bridge/Doctrine/Messenger/AbstractDoctrineMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ abstract class AbstractDoctrineMiddleware implements MiddlewareInterface
2828
protected $managerRegistry;
2929
protected $entityManagerName;
3030

31-
public function __construct(ManagerRegistry $managerRegistry, string $entityManagerName = null)
31+
public function __construct(ManagerRegistry $managerRegistry, ?string $entityManagerName = null)
3232
{
3333
$this->managerRegistry = $managerRegistry;
3434
$this->entityManagerName = $entityManagerName;

0 commit comments

Comments
 (0)