Skip to content

Commit 8a35ee2

Browse files
chore: fix CI (#6144)
* chore: disable keep_legacy_inflector in Doctrine tests * chore: fix Doctrine ORM enable_lazy_ghost_objects deprecation in tests configuration * chore: fix null value for CS * chore: fix CS post rebase from main * chore: remove useless legacy test services * chore: fix YAML with Symfony dev dependencies
1 parent 66e2672 commit 8a35ee2

Some content is hidden

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

44 files changed

+180
-193
lines changed

components.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
}
8787

8888
$warned = [];
89-
$getComponentNamespace = function (ReflectionClass $r, ReflectionClass $inside = null) use ($psrMap, $warned, $ignoreList, $namespace) {
89+
$getComponentNamespace = function (ReflectionClass $r, ?ReflectionClass $inside = null) use ($psrMap, $warned, $ignoreList, $namespace) {
9090
$ns = $r->getNamespaceName();
9191
// Find this components namespace
9292
$nsParts = explode('\\', $ns);

src/Doctrine/Common/State/LinksHandlerTrait.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private function getLinks(string $resourceClass, Operation $operation, array $co
9292
/**
9393
* @param array<int|string,mixed> $identifiers
9494
*/
95-
private function getIdentifierValue(array &$identifiers, string $name = null): mixed
95+
private function getIdentifierValue(array &$identifiers, ?string $name = null): mixed
9696
{
9797
if (null !== $name && isset($identifiers[$name])) {
9898
$value = $identifiers[$name];
@@ -107,7 +107,7 @@ private function getIdentifierValue(array &$identifiers, string $name = null): m
107107
/**
108108
* @return \ApiPlatform\Metadata\Link[]|array
109109
*/
110-
private function getOperationLinks(Operation $operation = null): array
110+
private function getOperationLinks(?Operation $operation = null): array
111111
{
112112
if ($operation instanceof GraphQlOperation) {
113113
return $operation->getLinks() ?? [];

src/Doctrine/Odm/State/CollectionProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ final class CollectionProvider implements ProviderInterface
3636
/**
3737
* @param AggregationCollectionExtensionInterface[] $collectionExtensions
3838
*/
39-
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ManagerRegistry $managerRegistry, private readonly iterable $collectionExtensions = [], ContainerInterface $handleLinksLocator = null)
39+
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ManagerRegistry $managerRegistry, private readonly iterable $collectionExtensions = [], ?ContainerInterface $handleLinksLocator = null)
4040
{
4141
$this->resourceMetadataCollectionFactory = $resourceMetadataCollectionFactory;
4242
$this->handleLinksLocator = $handleLinksLocator;

src/Doctrine/Odm/State/ItemProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final class ItemProvider implements ProviderInterface
3939
/**
4040
* @param AggregationItemExtensionInterface[] $itemExtensions
4141
*/
42-
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ManagerRegistry $managerRegistry, private readonly iterable $itemExtensions = [], ContainerInterface $handleLinksLocator = null)
42+
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ManagerRegistry $managerRegistry, private readonly iterable $itemExtensions = [], ?ContainerInterface $handleLinksLocator = null)
4343
{
4444
$this->resourceMetadataCollectionFactory = $resourceMetadataCollectionFactory;
4545
$this->handleLinksLocator = $handleLinksLocator;

src/Doctrine/Odm/State/LinksHandlerTrait.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ trait LinksHandlerTrait
3131

3232
private ManagerRegistry $managerRegistry;
3333

34-
private function handleLinks(Builder $aggregationBuilder, array $identifiers, array $context, string $resourceClass, Operation $operation = null): void
34+
private function handleLinks(Builder $aggregationBuilder, array $identifiers, array $context, string $resourceClass, ?Operation $operation = null): void
3535
{
3636
if (!$identifiers) {
3737
return;

src/Doctrine/Odm/Tests/Fixtures/Document/Dummy.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,12 @@ public function getFoo(): ?array
152152
return $this->foo;
153153
}
154154

155-
public function setFoo(array $foo = null): void
155+
public function setFoo(?array $foo = null): void
156156
{
157157
$this->foo = $foo;
158158
}
159159

160-
public function setDummyDate(\DateTime $dummyDate = null): void
160+
public function setDummyDate(?\DateTime $dummyDate = null): void
161161
{
162162
$this->dummyDate = $dummyDate;
163163
}

src/Doctrine/Odm/Tests/Fixtures/Document/RelatedDummy.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function getThirdLevel(): ?ThirdLevel
113113
return $this->thirdLevel;
114114
}
115115

116-
public function setThirdLevel(ThirdLevel $thirdLevel = null): void
116+
public function setThirdLevel(?ThirdLevel $thirdLevel = null): void
117117
{
118118
$this->thirdLevel = $thirdLevel;
119119
}

src/Doctrine/Odm/Tests/Fixtures/Document/ThirdLevel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function getFourthLevel(): ?FourthLevel
7777
return $this->fourthLevel;
7878
}
7979

80-
public function setFourthLevel(FourthLevel $fourthLevel = null): void
80+
public function setFourthLevel(?FourthLevel $fourthLevel = null): void
8181
{
8282
$this->fourthLevel = $fourthLevel;
8383
}

src/Doctrine/Odm/Tests/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ api_platform:
2121
json: ['application/json']
2222
doctrine: false
2323
doctrine_mongodb_odm: true
24+
keep_legacy_inflector: false
2425
mapping:
2526
paths:
2627
- '%kernel.project_dir%/Fixtures/Document'

src/Doctrine/Orm/State/CollectionProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final class CollectionProvider implements ProviderInterface
3939
/**
4040
* @param QueryCollectionExtensionInterface[] $collectionExtensions
4141
*/
42-
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ManagerRegistry $managerRegistry, private readonly iterable $collectionExtensions = [], ContainerInterface $handleLinksLocator = null)
42+
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ManagerRegistry $managerRegistry, private readonly iterable $collectionExtensions = [], ?ContainerInterface $handleLinksLocator = null)
4343
{
4444
$this->resourceMetadataCollectionFactory = $resourceMetadataCollectionFactory;
4545
$this->handleLinksLocator = $handleLinksLocator;

src/Doctrine/Orm/State/ItemProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final class ItemProvider implements ProviderInterface
3939
/**
4040
* @param QueryItemExtensionInterface[] $itemExtensions
4141
*/
42-
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ManagerRegistry $managerRegistry, private readonly iterable $itemExtensions = [], ContainerInterface $handleLinksLocator = null)
42+
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ManagerRegistry $managerRegistry, private readonly iterable $itemExtensions = [], ?ContainerInterface $handleLinksLocator = null)
4343
{
4444
$this->resourceMetadataCollectionFactory = $resourceMetadataCollectionFactory;
4545
$this->handleLinksLocator = $handleLinksLocator;

src/Doctrine/Orm/Tests/Fixtures/Entity/CompositeLabel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function getValue(): ?string
5353
*
5454
* @param string|null $value the value to set
5555
*/
56-
public function setValue(string $value = null): void
56+
public function setValue(?string $value = null): void
5757
{
5858
$this->value = $value;
5959
}

src/Doctrine/Orm/Tests/Fixtures/Entity/Dummy.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,12 @@ public function getFoo(): ?array
194194
return $this->foo;
195195
}
196196

197-
public function setFoo(array $foo = null): void
197+
public function setFoo(?array $foo = null): void
198198
{
199199
$this->foo = $foo;
200200
}
201201

202-
public function setDummyDate(\DateTime $dummyDate = null): void
202+
public function setDummyDate(?\DateTime $dummyDate = null): void
203203
{
204204
$this->dummyDate = $dummyDate;
205205
}

src/Doctrine/Orm/Tests/Fixtures/Entity/RelatedDummy.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public function getThirdLevel(): ?ThirdLevel
169169
return $this->thirdLevel;
170170
}
171171

172-
public function setThirdLevel(ThirdLevel $thirdLevel = null): void
172+
public function setThirdLevel(?ThirdLevel $thirdLevel = null): void
173173
{
174174
$this->thirdLevel = $thirdLevel;
175175
}

src/Doctrine/Orm/Tests/Fixtures/Entity/ThirdLevel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function getFourthLevel(): ?FourthLevel
9797
return $this->fourthLevel;
9898
}
9999

100-
public function setFourthLevel(FourthLevel $fourthLevel = null): void
100+
public function setFourthLevel(?FourthLevel $fourthLevel = null): void
101101
{
102102
$this->fourthLevel = $fourthLevel;
103103
}

src/Doctrine/Orm/Tests/config.yml

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ doctrine:
88

99
orm:
1010
auto_generate_proxy_classes: '%kernel.debug%'
11+
enable_lazy_ghost_objects: true
1112
mappings:
1213
ApiPlatform\Doctrine\Orm\Tests\Fixtures\Entity:
1314
type: attribute
@@ -20,6 +21,7 @@ api_platform:
2021
formats:
2122
json: ['application/json']
2223
doctrine: true
24+
keep_legacy_inflector: false
2325
mapping:
2426
paths:
2527
- '%kernel.project_dir%/Fixtures/Entity'

src/GraphQl/Resolver/Factory/ResolverFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function __invoke(?string $resourceClass = null, ?string $rootClass = nul
5555
};
5656
}
5757

58-
private function resolve(?array $source, array $args, ResolveInfo $info, string $rootClass = null, Operation $operation = null, mixed $body)
58+
private function resolve(?array $source, array $args, ResolveInfo $info, ?string $rootClass = null, ?Operation $operation = null, mixed $body = null)
5959
{
6060
// Handles relay nodes
6161
$operation ??= new Query();

src/JsonApi/Serializer/ItemNormalizer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ final class ItemNormalizer extends AbstractItemNormalizer
5656

5757
private array $componentsCache = [];
5858

59-
public function __construct(PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, PropertyMetadataFactoryInterface $propertyMetadataFactory, IriConverterInterface|LegacyIriConverterInterface $iriConverter, ResourceClassResolverInterface|LegacyResourceClassResolverInterface $resourceClassResolver, PropertyAccessorInterface $propertyAccessor = null, NameConverterInterface $nameConverter = null, ClassMetadataFactoryInterface $classMetadataFactory = null, array $defaultContext = [], ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory = null, ResourceAccessCheckerInterface $resourceAccessChecker = null, protected ?TagCollectorInterface $tagCollector = null)
59+
public function __construct(PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, PropertyMetadataFactoryInterface $propertyMetadataFactory, IriConverterInterface|LegacyIriConverterInterface $iriConverter, ResourceClassResolverInterface|LegacyResourceClassResolverInterface $resourceClassResolver, ?PropertyAccessorInterface $propertyAccessor = null, ?NameConverterInterface $nameConverter = null, ?ClassMetadataFactoryInterface $classMetadataFactory = null, array $defaultContext = [], ?ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory = null, ?ResourceAccessCheckerInterface $resourceAccessChecker = null, protected ?TagCollectorInterface $tagCollector = null)
6060
{
6161
parent::__construct($propertyNameCollectionFactory, $propertyMetadataFactory, $iriConverter, $resourceClassResolver, $propertyAccessor, $nameConverter, $classMetadataFactory, $defaultContext, $resourceMetadataCollectionFactory, $resourceAccessChecker, $tagCollector);
6262
}

src/JsonLd/Serializer/ItemNormalizer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ final class ItemNormalizer extends AbstractItemNormalizer
4848

4949
public const FORMAT = 'jsonld';
5050

51-
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, PropertyMetadataFactoryInterface $propertyMetadataFactory, IriConverterInterface|LegacyIriConverterInterface $iriConverter, ResourceClassResolverInterface|LegacyResourceClassResolverInterface $resourceClassResolver, private readonly ContextBuilderInterface $contextBuilder, PropertyAccessorInterface $propertyAccessor = null, NameConverterInterface $nameConverter = null, ClassMetadataFactoryInterface $classMetadataFactory = null, array $defaultContext = [], ResourceAccessCheckerInterface $resourceAccessChecker = null, protected ?TagCollectorInterface $tagCollector = null)
51+
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, PropertyMetadataFactoryInterface $propertyMetadataFactory, IriConverterInterface|LegacyIriConverterInterface $iriConverter, ResourceClassResolverInterface|LegacyResourceClassResolverInterface $resourceClassResolver, private readonly ContextBuilderInterface $contextBuilder, ?PropertyAccessorInterface $propertyAccessor = null, ?NameConverterInterface $nameConverter = null, ?ClassMetadataFactoryInterface $classMetadataFactory = null, array $defaultContext = [], ?ResourceAccessCheckerInterface $resourceAccessChecker = null, protected ?TagCollectorInterface $tagCollector = null)
5252
{
5353
parent::__construct($propertyNameCollectionFactory, $propertyMetadataFactory, $iriConverter, $resourceClassResolver, $propertyAccessor, $nameConverter, $classMetadataFactory, $defaultContext, $resourceMetadataCollectionFactory, $resourceAccessChecker, $tagCollector);
5454
}

src/Metadata/Delete.php

+13-13
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ public function __construct(
3535
?string $sunset = null,
3636
?string $acceptPatch = null,
3737
$status = null,
38-
string $host = null,
39-
array $schemes = null,
40-
string $condition = null,
41-
string $controller = null,
42-
array $headers = null,
43-
array $cacheHeaders = null,
44-
array $paginationViaCursor = null,
45-
array $hydraContext = null,
46-
array $openapiContext = null,
47-
bool|OpenApiOperation $openapi = null,
48-
array $exceptionToStatus = null,
49-
bool $queryParameterValidationEnabled = null,
50-
array $links = null,
38+
?string $host = null,
39+
?array $schemes = null,
40+
?string $condition = null,
41+
?string $controller = null,
42+
?array $headers = null,
43+
?array $cacheHeaders = null,
44+
?array $paginationViaCursor = null,
45+
?array $hydraContext = null,
46+
?array $openapiContext = null,
47+
bool|OpenApiOperation|null $openapi = null,
48+
?array $exceptionToStatus = null,
49+
?bool $queryParameterValidationEnabled = null,
50+
?array $links = null,
5151

5252
?string $shortName = null,
5353
?string $class = null,

src/Metadata/Error.php

+13-13
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ public function __construct(
3535
?string $sunset = null,
3636
?string $acceptPatch = null,
3737
$status = null,
38-
string $host = null,
39-
array $schemes = null,
40-
string $condition = null,
41-
string $controller = null,
42-
array $headers = null,
43-
array $cacheHeaders = null,
44-
array $paginationViaCursor = null,
45-
array $hydraContext = null,
46-
array $openapiContext = null,
47-
bool|OpenApiOperation $openapi = null,
48-
array $exceptionToStatus = null,
49-
bool $queryParameterValidationEnabled = null,
50-
array $links = null,
38+
?string $host = null,
39+
?array $schemes = null,
40+
?string $condition = null,
41+
?string $controller = null,
42+
?array $headers = null,
43+
?array $cacheHeaders = null,
44+
?array $paginationViaCursor = null,
45+
?array $hydraContext = null,
46+
?array $openapiContext = null,
47+
bool|OpenApiOperation|null $openapi = null,
48+
?array $exceptionToStatus = null,
49+
?bool $queryParameterValidationEnabled = null,
50+
?array $links = null,
5151

5252
?string $shortName = null,
5353
?string $class = null,

src/Metadata/Get.php

+13-13
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ public function __construct(
3535
?string $sunset = null,
3636
?string $acceptPatch = null,
3737
$status = null,
38-
string $host = null,
39-
array $schemes = null,
40-
string $condition = null,
41-
string $controller = null,
42-
array $headers = null,
43-
array $cacheHeaders = null,
44-
array $paginationViaCursor = null,
45-
array $hydraContext = null,
46-
array $openapiContext = null,
47-
bool|OpenApiOperation $openapi = null,
48-
array $exceptionToStatus = null,
49-
bool $queryParameterValidationEnabled = null,
50-
array $links = null,
38+
?string $host = null,
39+
?array $schemes = null,
40+
?string $condition = null,
41+
?string $controller = null,
42+
?array $headers = null,
43+
?array $cacheHeaders = null,
44+
?array $paginationViaCursor = null,
45+
?array $hydraContext = null,
46+
?array $openapiContext = null,
47+
bool|OpenApiOperation|null $openapi = null,
48+
?array $exceptionToStatus = null,
49+
?bool $queryParameterValidationEnabled = null,
50+
?array $links = null,
5151

5252
?string $shortName = null,
5353
?string $class = null,

src/Metadata/GetCollection.php

+13-13
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ public function __construct(
3535
?string $sunset = null,
3636
?string $acceptPatch = null,
3737
$status = null,
38-
string $host = null,
39-
array $schemes = null,
40-
string $condition = null,
41-
string $controller = null,
42-
array $headers = null,
43-
array $cacheHeaders = null,
44-
array $paginationViaCursor = null,
45-
array $hydraContext = null,
46-
array $openapiContext = null,
47-
bool|OpenApiOperation $openapi = null,
48-
array $exceptionToStatus = null,
49-
bool $queryParameterValidationEnabled = null,
50-
array $links = null,
38+
?string $host = null,
39+
?array $schemes = null,
40+
?string $condition = null,
41+
?string $controller = null,
42+
?array $headers = null,
43+
?array $cacheHeaders = null,
44+
?array $paginationViaCursor = null,
45+
?array $hydraContext = null,
46+
?array $openapiContext = null,
47+
bool|OpenApiOperation|null $openapi = null,
48+
?array $exceptionToStatus = null,
49+
?bool $queryParameterValidationEnabled = null,
50+
?array $links = null,
5151

5252
?string $shortName = null,
5353
?string $class = null,

src/Metadata/NotExposed.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ public function __construct(
5050
?array $schemes = null,
5151
?string $condition = null,
5252
?string $controller = 'api_platform.action.not_exposed',
53-
array $headers = null,
54-
array $cacheHeaders = null,
55-
array $paginationViaCursor = null,
53+
?array $headers = null,
54+
?array $cacheHeaders = null,
55+
?array $paginationViaCursor = null,
5656

5757
?array $hydraContext = null,
5858
?array $openapiContext = null,

src/Metadata/Patch.php

+13-13
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ public function __construct(
3535
?string $sunset = null,
3636
?string $acceptPatch = null,
3737
$status = null,
38-
string $host = null,
39-
array $schemes = null,
40-
string $condition = null,
41-
string $controller = null,
42-
array $headers = null,
43-
array $cacheHeaders = null,
44-
array $paginationViaCursor = null,
45-
array $hydraContext = null,
46-
array $openapiContext = null,
47-
bool|OpenApiOperation $openapi = null,
48-
array $exceptionToStatus = null,
49-
bool $queryParameterValidationEnabled = null,
50-
array $links = null,
38+
?string $host = null,
39+
?array $schemes = null,
40+
?string $condition = null,
41+
?string $controller = null,
42+
?array $headers = null,
43+
?array $cacheHeaders = null,
44+
?array $paginationViaCursor = null,
45+
?array $hydraContext = null,
46+
?array $openapiContext = null,
47+
bool|OpenApiOperation|null $openapi = null,
48+
?array $exceptionToStatus = null,
49+
?bool $queryParameterValidationEnabled = null,
50+
?array $links = null,
5151

5252
?string $shortName = null,
5353
?string $class = null,

0 commit comments

Comments
 (0)