Skip to content

Commit bb99f55

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: [CS] Fix explicit nullable types
2 parents 5c7184c + 0df8d03 commit bb99f55

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

create_framework/separation_of_concerns.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ And move the ``is_leap_year()`` function to its own class too::
120120

121121
class LeapYear
122122
{
123-
public function isLeapYear(int $year = null): bool
123+
public function isLeapYear(?int $year = null): bool
124124
{
125125
if (null === $year) {
126126
$year = date('Y');

create_framework/templating.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ framework does not need to be modified in any way, create a new
146146
use Symfony\Component\HttpFoundation\Response;
147147
use Symfony\Component\Routing;
148148

149-
function is_leap_year(int $year = null): bool
149+
function is_leap_year(?int $year = null): bool
150150
{
151151
if (null === $year) {
152152
$year = (int)date('Y');

reference/dic_tags.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ the :class:`Symfony\\Component\\HttpKernel\\CacheWarmer\\CacheWarmerInterface` i
483483

484484
class MyCustomWarmer implements CacheWarmerInterface
485485
{
486-
public function warmUp(string $cacheDir, string $buildDir = null): array
486+
public function warmUp(string $cacheDir, ?string $buildDir = null): array
487487
{
488488
// ... do some sort of operations to "warm" your cache
489489

reference/forms/types/enum.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ implement ``TranslatableInterface`` to translate or display custom labels::
6666
case Center = 'Center aligned';
6767
case Right = 'Right aligned';
6868

69-
public function trans(TranslatorInterface $translator, string $locale = null): string
69+
public function trans(TranslatorInterface $translator, ?string $locale = null): string
7070
{
7171
// Translate enum from name (Left, Center or Right)
7272
return $translator->trans($this->name, locale: $locale);

serializer/custom_context_builders.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ value is ``0000-00-00``. To do that you'll first have to create your normalizer:
2929
{
3030
use DenormalizerAwareTrait;
3131

32-
public function denormalize($data, string $type, string $format = null, array $context = []): mixed
32+
public function denormalize($data, string $type, ?string $format = null, array $context = []): mixed
3333
{
3434
if ('0000-00-00' === $data) {
3535
return null;
@@ -40,7 +40,7 @@ value is ``0000-00-00``. To do that you'll first have to create your normalizer:
4040
return $this->denormalizer->denormalize($data, $type, $format, $context);
4141
}
4242

43-
public function supportsDenormalization($data, string $type, string $format = null, array $context = []): bool
43+
public function supportsDenormalization($data, string $type, ?string $format = null, array $context = []): bool
4444
{
4545
return true === ($context['zero_datetime_to_null'] ?? false)
4646
&& is_a($type, \DateTimeInterface::class, true);

validation/custom_constraint.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ You can use ``#[HasNamedArguments]`` to make some constraint options required::
5555
#[HasNamedArguments]
5656
public function __construct(
5757
public string $mode,
58-
array $groups = null,
58+
?array $groups = null,
5959
mixed $payload = null,
6060
) {
6161
parent::__construct([], $groups, $payload);

0 commit comments

Comments
 (0)