Skip to content

Commit

Permalink
chore: fix CI (#6144)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
vincentchalamon authored Feb 4, 2024
1 parent 66e2672 commit 8a35ee2
Show file tree
Hide file tree
Showing 44 changed files with 180 additions and 193 deletions.
2 changes: 1 addition & 1 deletion components.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
}

$warned = [];
$getComponentNamespace = function (ReflectionClass $r, ReflectionClass $inside = null) use ($psrMap, $warned, $ignoreList, $namespace) {
$getComponentNamespace = function (ReflectionClass $r, ?ReflectionClass $inside = null) use ($psrMap, $warned, $ignoreList, $namespace) {
$ns = $r->getNamespaceName();
// Find this components namespace
$nsParts = explode('\\', $ns);
Expand Down
4 changes: 2 additions & 2 deletions src/Doctrine/Common/State/LinksHandlerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private function getLinks(string $resourceClass, Operation $operation, array $co
/**
* @param array<int|string,mixed> $identifiers
*/
private function getIdentifierValue(array &$identifiers, string $name = null): mixed
private function getIdentifierValue(array &$identifiers, ?string $name = null): mixed
{
if (null !== $name && isset($identifiers[$name])) {
$value = $identifiers[$name];
Expand All @@ -107,7 +107,7 @@ private function getIdentifierValue(array &$identifiers, string $name = null): m
/**
* @return \ApiPlatform\Metadata\Link[]|array
*/
private function getOperationLinks(Operation $operation = null): array
private function getOperationLinks(?Operation $operation = null): array
{
if ($operation instanceof GraphQlOperation) {
return $operation->getLinks() ?? [];
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Odm/State/CollectionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ final class CollectionProvider implements ProviderInterface
/**
* @param AggregationCollectionExtensionInterface[] $collectionExtensions
*/
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ManagerRegistry $managerRegistry, private readonly iterable $collectionExtensions = [], ContainerInterface $handleLinksLocator = null)
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ManagerRegistry $managerRegistry, private readonly iterable $collectionExtensions = [], ?ContainerInterface $handleLinksLocator = null)
{
$this->resourceMetadataCollectionFactory = $resourceMetadataCollectionFactory;
$this->handleLinksLocator = $handleLinksLocator;
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Odm/State/ItemProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final class ItemProvider implements ProviderInterface
/**
* @param AggregationItemExtensionInterface[] $itemExtensions
*/
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ManagerRegistry $managerRegistry, private readonly iterable $itemExtensions = [], ContainerInterface $handleLinksLocator = null)
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ManagerRegistry $managerRegistry, private readonly iterable $itemExtensions = [], ?ContainerInterface $handleLinksLocator = null)
{
$this->resourceMetadataCollectionFactory = $resourceMetadataCollectionFactory;
$this->handleLinksLocator = $handleLinksLocator;
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Odm/State/LinksHandlerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ trait LinksHandlerTrait

private ManagerRegistry $managerRegistry;

private function handleLinks(Builder $aggregationBuilder, array $identifiers, array $context, string $resourceClass, Operation $operation = null): void
private function handleLinks(Builder $aggregationBuilder, array $identifiers, array $context, string $resourceClass, ?Operation $operation = null): void
{
if (!$identifiers) {
return;
Expand Down
4 changes: 2 additions & 2 deletions src/Doctrine/Odm/Tests/Fixtures/Document/Dummy.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ public function getFoo(): ?array
return $this->foo;
}

public function setFoo(array $foo = null): void
public function setFoo(?array $foo = null): void
{
$this->foo = $foo;
}

public function setDummyDate(\DateTime $dummyDate = null): void
public function setDummyDate(?\DateTime $dummyDate = null): void
{
$this->dummyDate = $dummyDate;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Odm/Tests/Fixtures/Document/RelatedDummy.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function getThirdLevel(): ?ThirdLevel
return $this->thirdLevel;
}

public function setThirdLevel(ThirdLevel $thirdLevel = null): void
public function setThirdLevel(?ThirdLevel $thirdLevel = null): void
{
$this->thirdLevel = $thirdLevel;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Odm/Tests/Fixtures/Document/ThirdLevel.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function getFourthLevel(): ?FourthLevel
return $this->fourthLevel;
}

public function setFourthLevel(FourthLevel $fourthLevel = null): void
public function setFourthLevel(?FourthLevel $fourthLevel = null): void
{
$this->fourthLevel = $fourthLevel;
}
Expand Down
1 change: 1 addition & 0 deletions src/Doctrine/Odm/Tests/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ api_platform:
json: ['application/json']
doctrine: false
doctrine_mongodb_odm: true
keep_legacy_inflector: false
mapping:
paths:
- '%kernel.project_dir%/Fixtures/Document'
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Orm/State/CollectionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final class CollectionProvider implements ProviderInterface
/**
* @param QueryCollectionExtensionInterface[] $collectionExtensions
*/
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ManagerRegistry $managerRegistry, private readonly iterable $collectionExtensions = [], ContainerInterface $handleLinksLocator = null)
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ManagerRegistry $managerRegistry, private readonly iterable $collectionExtensions = [], ?ContainerInterface $handleLinksLocator = null)
{
$this->resourceMetadataCollectionFactory = $resourceMetadataCollectionFactory;
$this->handleLinksLocator = $handleLinksLocator;
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Orm/State/ItemProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final class ItemProvider implements ProviderInterface
/**
* @param QueryItemExtensionInterface[] $itemExtensions
*/
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ManagerRegistry $managerRegistry, private readonly iterable $itemExtensions = [], ContainerInterface $handleLinksLocator = null)
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ManagerRegistry $managerRegistry, private readonly iterable $itemExtensions = [], ?ContainerInterface $handleLinksLocator = null)
{
$this->resourceMetadataCollectionFactory = $resourceMetadataCollectionFactory;
$this->handleLinksLocator = $handleLinksLocator;
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Orm/Tests/Fixtures/Entity/CompositeLabel.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function getValue(): ?string
*
* @param string|null $value the value to set
*/
public function setValue(string $value = null): void
public function setValue(?string $value = null): void
{
$this->value = $value;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Doctrine/Orm/Tests/Fixtures/Entity/Dummy.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,12 @@ public function getFoo(): ?array
return $this->foo;
}

public function setFoo(array $foo = null): void
public function setFoo(?array $foo = null): void
{
$this->foo = $foo;
}

public function setDummyDate(\DateTime $dummyDate = null): void
public function setDummyDate(?\DateTime $dummyDate = null): void
{
$this->dummyDate = $dummyDate;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Orm/Tests/Fixtures/Entity/RelatedDummy.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public function getThirdLevel(): ?ThirdLevel
return $this->thirdLevel;
}

public function setThirdLevel(ThirdLevel $thirdLevel = null): void
public function setThirdLevel(?ThirdLevel $thirdLevel = null): void
{
$this->thirdLevel = $thirdLevel;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Orm/Tests/Fixtures/Entity/ThirdLevel.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function getFourthLevel(): ?FourthLevel
return $this->fourthLevel;
}

public function setFourthLevel(FourthLevel $fourthLevel = null): void
public function setFourthLevel(?FourthLevel $fourthLevel = null): void
{
$this->fourthLevel = $fourthLevel;
}
Expand Down
2 changes: 2 additions & 0 deletions src/Doctrine/Orm/Tests/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ doctrine:

orm:
auto_generate_proxy_classes: '%kernel.debug%'
enable_lazy_ghost_objects: true
mappings:
ApiPlatform\Doctrine\Orm\Tests\Fixtures\Entity:
type: attribute
Expand All @@ -20,6 +21,7 @@ api_platform:
formats:
json: ['application/json']
doctrine: true
keep_legacy_inflector: false
mapping:
paths:
- '%kernel.project_dir%/Fixtures/Entity'
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQl/Resolver/Factory/ResolverFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __invoke(?string $resourceClass = null, ?string $rootClass = nul
};
}

private function resolve(?array $source, array $args, ResolveInfo $info, string $rootClass = null, Operation $operation = null, mixed $body)
private function resolve(?array $source, array $args, ResolveInfo $info, ?string $rootClass = null, ?Operation $operation = null, mixed $body = null)
{
// Handles relay nodes
$operation ??= new Query();
Expand Down
2 changes: 1 addition & 1 deletion src/JsonApi/Serializer/ItemNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ final class ItemNormalizer extends AbstractItemNormalizer

private array $componentsCache = [];

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)
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)
{
parent::__construct($propertyNameCollectionFactory, $propertyMetadataFactory, $iriConverter, $resourceClassResolver, $propertyAccessor, $nameConverter, $classMetadataFactory, $defaultContext, $resourceMetadataCollectionFactory, $resourceAccessChecker, $tagCollector);
}
Expand Down
2 changes: 1 addition & 1 deletion src/JsonLd/Serializer/ItemNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class ItemNormalizer extends AbstractItemNormalizer

public const FORMAT = 'jsonld';

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)
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)
{
parent::__construct($propertyNameCollectionFactory, $propertyMetadataFactory, $iriConverter, $resourceClassResolver, $propertyAccessor, $nameConverter, $classMetadataFactory, $defaultContext, $resourceMetadataCollectionFactory, $resourceAccessChecker, $tagCollector);
}
Expand Down
26 changes: 13 additions & 13 deletions src/Metadata/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ public function __construct(
?string $sunset = null,
?string $acceptPatch = null,
$status = null,
string $host = null,
array $schemes = null,
string $condition = null,
string $controller = null,
array $headers = null,
array $cacheHeaders = null,
array $paginationViaCursor = null,
array $hydraContext = null,
array $openapiContext = null,
bool|OpenApiOperation $openapi = null,
array $exceptionToStatus = null,
bool $queryParameterValidationEnabled = null,
array $links = null,
?string $host = null,
?array $schemes = null,
?string $condition = null,
?string $controller = null,
?array $headers = null,
?array $cacheHeaders = null,
?array $paginationViaCursor = null,
?array $hydraContext = null,
?array $openapiContext = null,
bool|OpenApiOperation|null $openapi = null,
?array $exceptionToStatus = null,
?bool $queryParameterValidationEnabled = null,
?array $links = null,

?string $shortName = null,
?string $class = null,
Expand Down
26 changes: 13 additions & 13 deletions src/Metadata/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ public function __construct(
?string $sunset = null,
?string $acceptPatch = null,
$status = null,
string $host = null,
array $schemes = null,
string $condition = null,
string $controller = null,
array $headers = null,
array $cacheHeaders = null,
array $paginationViaCursor = null,
array $hydraContext = null,
array $openapiContext = null,
bool|OpenApiOperation $openapi = null,
array $exceptionToStatus = null,
bool $queryParameterValidationEnabled = null,
array $links = null,
?string $host = null,
?array $schemes = null,
?string $condition = null,
?string $controller = null,
?array $headers = null,
?array $cacheHeaders = null,
?array $paginationViaCursor = null,
?array $hydraContext = null,
?array $openapiContext = null,
bool|OpenApiOperation|null $openapi = null,
?array $exceptionToStatus = null,
?bool $queryParameterValidationEnabled = null,
?array $links = null,

?string $shortName = null,
?string $class = null,
Expand Down
26 changes: 13 additions & 13 deletions src/Metadata/Get.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ public function __construct(
?string $sunset = null,
?string $acceptPatch = null,
$status = null,
string $host = null,
array $schemes = null,
string $condition = null,
string $controller = null,
array $headers = null,
array $cacheHeaders = null,
array $paginationViaCursor = null,
array $hydraContext = null,
array $openapiContext = null,
bool|OpenApiOperation $openapi = null,
array $exceptionToStatus = null,
bool $queryParameterValidationEnabled = null,
array $links = null,
?string $host = null,
?array $schemes = null,
?string $condition = null,
?string $controller = null,
?array $headers = null,
?array $cacheHeaders = null,
?array $paginationViaCursor = null,
?array $hydraContext = null,
?array $openapiContext = null,
bool|OpenApiOperation|null $openapi = null,
?array $exceptionToStatus = null,
?bool $queryParameterValidationEnabled = null,
?array $links = null,

?string $shortName = null,
?string $class = null,
Expand Down
26 changes: 13 additions & 13 deletions src/Metadata/GetCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ public function __construct(
?string $sunset = null,
?string $acceptPatch = null,
$status = null,
string $host = null,
array $schemes = null,
string $condition = null,
string $controller = null,
array $headers = null,
array $cacheHeaders = null,
array $paginationViaCursor = null,
array $hydraContext = null,
array $openapiContext = null,
bool|OpenApiOperation $openapi = null,
array $exceptionToStatus = null,
bool $queryParameterValidationEnabled = null,
array $links = null,
?string $host = null,
?array $schemes = null,
?string $condition = null,
?string $controller = null,
?array $headers = null,
?array $cacheHeaders = null,
?array $paginationViaCursor = null,
?array $hydraContext = null,
?array $openapiContext = null,
bool|OpenApiOperation|null $openapi = null,
?array $exceptionToStatus = null,
?bool $queryParameterValidationEnabled = null,
?array $links = null,

?string $shortName = null,
?string $class = null,
Expand Down
6 changes: 3 additions & 3 deletions src/Metadata/NotExposed.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public function __construct(
?array $schemes = null,
?string $condition = null,
?string $controller = 'api_platform.action.not_exposed',
array $headers = null,
array $cacheHeaders = null,
array $paginationViaCursor = null,
?array $headers = null,
?array $cacheHeaders = null,
?array $paginationViaCursor = null,

?array $hydraContext = null,
?array $openapiContext = null,
Expand Down
26 changes: 13 additions & 13 deletions src/Metadata/Patch.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ public function __construct(
?string $sunset = null,
?string $acceptPatch = null,
$status = null,
string $host = null,
array $schemes = null,
string $condition = null,
string $controller = null,
array $headers = null,
array $cacheHeaders = null,
array $paginationViaCursor = null,
array $hydraContext = null,
array $openapiContext = null,
bool|OpenApiOperation $openapi = null,
array $exceptionToStatus = null,
bool $queryParameterValidationEnabled = null,
array $links = null,
?string $host = null,
?array $schemes = null,
?string $condition = null,
?string $controller = null,
?array $headers = null,
?array $cacheHeaders = null,
?array $paginationViaCursor = null,
?array $hydraContext = null,
?array $openapiContext = null,
bool|OpenApiOperation|null $openapi = null,
?array $exceptionToStatus = null,
?bool $queryParameterValidationEnabled = null,
?array $links = null,

?string $shortName = null,
?string $class = null,
Expand Down
Loading

0 comments on commit 8a35ee2

Please sign in to comment.