Skip to content

Commit bbd0cb4

Browse files
chore: disable nullable_type_declaration_for_default_null_value CS rule
1 parent fed666a commit bbd0cb4

File tree

11 files changed

+17
-10
lines changed

11 files changed

+17
-10
lines changed

.php-cs-fixer.dist.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@
8989
'no_unset_on_property' => true,
9090
'no_useless_else' => true,
9191
'no_useless_return' => true,
92+
'nullable_type_declaration_for_default_null_value' => [
93+
// enabled by default on v3.49.0 in SymfonySet
94+
// https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/7773
95+
'use_nullable_type_declaration' => false, // temporary
96+
],
9297
'ordered_imports' => [
9398
'imports_order' => [
9499
'class',

src/Api/FilterLocatorTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private function setFilterLocator(?ContainerInterface $filterLocator, bool $allo
4545
/**
4646
* Gets a filter with a backward compatibility.
4747
*/
48-
private function getFilter(string $filterId): null|FilterInterface|MetadataFilterInterface
48+
private function getFilter(string $filterId): FilterInterface|MetadataFilterInterface|null
4949
{
5050
if ($this->filterLocator && $this->filterLocator->has($filterId)) {
5151
return $this->filterLocator->get($filterId);

src/Doctrine/Common/Filter/SearchFilterTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ trait SearchFilterTrait
3434

3535
protected IriConverterInterface|LegacyIriConverterInterface $iriConverter;
3636
protected PropertyAccessorInterface $propertyAccessor;
37-
protected null|IdentifiersExtractorInterface|LegacyIdentifiersExtractorInterface $identifiersExtractor = null;
37+
protected IdentifiersExtractorInterface|LegacyIdentifiersExtractorInterface|null $identifiersExtractor = null;
3838

3939
/**
4040
* {@inheritdoc}

src/Doctrine/Odm/Filter/SearchFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ final class SearchFilter extends AbstractFilter implements SearchFilterInterface
142142

143143
public const DOCTRINE_INTEGER_TYPE = [MongoDbType::INTEGER, MongoDbType::INT];
144144

145-
public function __construct(ManagerRegistry $managerRegistry, IriConverterInterface|LegacyIriConverterInterface $iriConverter, null|IdentifiersExtractorInterface|LegacyIdentifiersExtractorInterface $identifiersExtractor, PropertyAccessorInterface $propertyAccessor = null, LoggerInterface $logger = null, array $properties = null, NameConverterInterface $nameConverter = null)
145+
public function __construct(ManagerRegistry $managerRegistry, IriConverterInterface|LegacyIriConverterInterface $iriConverter, IdentifiersExtractorInterface|LegacyIdentifiersExtractorInterface|null $identifiersExtractor, PropertyAccessorInterface $propertyAccessor = null, LoggerInterface $logger = null, array $properties = null, NameConverterInterface $nameConverter = null)
146146
{
147147
parent::__construct($managerRegistry, $logger, $properties, $nameConverter);
148148

src/ParameterValidator/FilterLocatorTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private function setFilterLocator(?ContainerInterface $filterLocator, bool $allo
4545
/**
4646
* Gets a filter with a backward compatibility.
4747
*/
48-
private function getFilter(string $filterId): null|FilterInterface
48+
private function getFilter(string $filterId): FilterInterface|null
4949
{
5050
if ($this->filterLocator && $this->filterLocator->has($filterId)) {
5151
return $this->filterLocator->get($filterId);

src/State/UriVariablesResolverTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
trait UriVariablesResolverTrait
2323
{
24-
private null|LegacyUriVariablesConverterInterface|UriVariablesConverterInterface $uriVariablesConverter = null;
24+
private LegacyUriVariablesConverterInterface|UriVariablesConverterInterface|null $uriVariablesConverter = null;
2525

2626
/**
2727
* Resolves an operation's UriVariables to their identifiers values.

src/Symfony/EventListener/DeserializeListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ final class DeserializeListener
4848
private SerializerInterface $serializer;
4949
private ?ProviderInterface $provider = null;
5050

51-
public function __construct(ProviderInterface|SerializerInterface $serializer, private readonly null|SerializerContextBuilderInterface|ResourceMetadataCollectionFactoryInterface $serializerContextBuilder = null, ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory = null, private ?TranslatorInterface $translator = null)
51+
public function __construct(ProviderInterface|SerializerInterface $serializer, private readonly SerializerContextBuilderInterface|ResourceMetadataCollectionFactoryInterface|null $serializerContextBuilder = null, ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory = null, private ?TranslatorInterface $translator = null)
5252
{
5353
if ($serializer instanceof ProviderInterface) {
5454
$this->provider = $serializer;

src/Symfony/EventListener/ErrorListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ public function __construct(
5757
private readonly array $errorFormats = [],
5858
private readonly array $exceptionToStatus = [],
5959
/** @phpstan-ignore-next-line we're not using this anymore but keeping for bc layer */
60-
private readonly null|IdentifiersExtractorInterface|LegacyIdentifiersExtractorInterface $identifiersExtractor = null,
61-
private readonly null|ResourceClassResolverInterface|LegacyResourceClassResolverInterface $resourceClassResolver = null,
60+
private readonly IdentifiersExtractorInterface|LegacyIdentifiersExtractorInterface|null $identifiersExtractor = null,
61+
private readonly ResourceClassResolverInterface|LegacyResourceClassResolverInterface|null $resourceClassResolver = null,
6262
Negotiator $negotiator = null,
6363
private readonly bool $problemCompliantErrors = true,
6464
) {

src/Symfony/EventListener/RespondListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final class RespondListener
3939
'DELETE' => Response::HTTP_NO_CONTENT,
4040
];
4141

42-
private null|IriConverterInterface|LegacyIriConverterInterface $iriConverter = null;
42+
private IriConverterInterface|LegacyIriConverterInterface|null $iriConverter = null;
4343
private ?ProcessorInterface $processor = null;
4444

4545
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory = null, IriConverterInterface|LegacyIriConverterInterface|ProcessorInterface $iriConverter = null)

src/Symfony/EventListener/WriteListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ final class WriteListener
5757
public function __construct(
5858
private readonly ProcessorInterface $processor,
5959
LegacyIriConverterInterface|IriConverterInterface|ResourceMetadataCollectionFactoryInterface $iriConverter = null,
60-
private readonly null|ResourceClassResolverInterface|LegacyResourceClassResolverInterface $resourceClassResolver = null,
60+
private readonly ResourceClassResolverInterface|LegacyResourceClassResolverInterface|null $resourceClassResolver = null,
6161
ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory = null,
6262
LegacyUriVariablesConverterInterface|UriVariablesConverterInterface $uriVariablesConverter = null,
6363
) {

tests/Fixtures/app/console

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* file that was distributed with this source code.
1111
*/
1212

13+
declare(strict_types=1);
14+
1315
use Symfony\Bundle\FrameworkBundle\Console\Application;
1416
use Symfony\Component\Console\Input\ArgvInput;
1517
use Symfony\Component\ErrorHandler\Debug;

0 commit comments

Comments
 (0)