Skip to content

Commit 6319e5d

Browse files
minor symfony#52174 DX: nullable_type_declaration (keradus)
This PR was merged into the 6.4 branch. Discussion ---------- DX: nullable_type_declaration | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | n/a | License | MIT https://cs.symfony.com/doc/rules/language_construct/nullable_type_declaration.html#example-1 requested in symfony#48095 (comment) I do not put this rule in ruleset, as it requires PHP 8 - if you want to move it to ``@Symfony`` ruleset, let me know There is concern how to have this rule configured and have PHPUnit bridge supporting 7.4, but I think I will leave it unresolved for now. Commits ------- 6aff9d9 DX: nullable_type_declaration
2 parents eee7e8f + 6aff9d9 commit 6319e5d

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
'header_comment' => ['header' => $fileHeaderComment],
3838
'modernize_strpos' => true,
3939
'get_class_to_class_keyword' => true,
40+
'nullable_type_declaration' => true,
4041
])
4142
->setRiskyAllowed(true)
4243
->setFinder(

src/Symfony/Component/DependencyInjection/Attribute/Autoconfigure.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct(
2929
public ?bool $autowire = null,
3030
public ?array $properties = null,
3131
public array|string|null $configurator = null,
32-
public string|null $constructor = null,
32+
public ?string $constructor = null,
3333
) {
3434
}
3535
}

src/Symfony/Component/Dotenv/Command/DotenvDumpCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
final class DotenvDumpCommand extends Command
3131
{
3232
private string $projectDir;
33-
private string|null $defaultEnv;
33+
private ?string $defaultEnv;
3434

3535
public function __construct(string $projectDir, string $defaultEnv = null)
3636
{

src/Symfony/Component/Form/Util/OrderedHashMapIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class OrderedHashMapIterator implements \Iterator
3232
private int $cursorId;
3333
/** @var array<int, int> */
3434
private array $managedCursors;
35-
private string|null $key = null;
35+
private ?string $key = null;
3636
/** @var TValue|null */
3737
private mixed $current = null;
3838

src/Symfony/Component/Notifier/Bridge/Novu/NovuOptions.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
class NovuOptions implements MessageOptionsInterface
2020
{
2121
public function __construct(
22-
private readonly string|null $subscriberId = null,
23-
private readonly string|null $firstName = null,
24-
private readonly string|null $lastName = null,
25-
private readonly string|null $email = null,
26-
private readonly string|null $phone = null,
27-
private readonly string|null $avatar = null,
28-
private readonly string|null $locale = null,
22+
private readonly ?string $subscriberId = null,
23+
private readonly ?string $firstName = null,
24+
private readonly ?string $lastName = null,
25+
private readonly ?string $email = null,
26+
private readonly ?string $phone = null,
27+
private readonly ?string $avatar = null,
28+
private readonly ?string $locale = null,
2929
private readonly array $options = [],
3030
) {
3131
}

src/Symfony/Component/Notifier/Bridge/Novu/NovuSubscriberRecipient.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ class NovuSubscriberRecipient implements RecipientInterface
2020
{
2121
public function __construct(
2222
private readonly string $subscriberId,
23-
private readonly string|null $firstName = null,
24-
private readonly string|null $lastName = null,
25-
private readonly string|null $email = null,
26-
private readonly string|null $phone = null,
27-
private readonly string|null $avatar = null,
28-
private readonly string|null $locale = null,
23+
private readonly ?string $firstName = null,
24+
private readonly ?string $lastName = null,
25+
private readonly ?string $email = null,
26+
private readonly ?string $phone = null,
27+
private readonly ?string $avatar = null,
28+
private readonly ?string $locale = null,
2929
) {
3030
}
3131

0 commit comments

Comments
 (0)