Skip to content

Commit

Permalink
chore: fix CI (#6143)
Browse files Browse the repository at this point in the history
* chore: fix wrong namespace in test document

* chore: fix CS nullable_type_declaration_for_default_null_value

* chore: update GitHub Actions versions
  • Loading branch information
vincentchalamon committed Feb 2, 2024
1 parent 0710361 commit 86be7df
Show file tree
Hide file tree
Showing 284 changed files with 1,269 additions and 1,269 deletions.
102 changes: 51 additions & 51 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/workflows/guides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup PHP with pre-release PECL extension
uses: shivammathur/setup-php@v2
with:
Expand All @@ -35,7 +35,7 @@ jobs:
composer global config --no-plugins allow-plugins.symfony/runtime true
composer global require php-documentation-generator/php-documentation-generator:dev-main
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/subtree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
split:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions docs/src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Kernel extends BaseKernel
private $declaredClasses = [];
private string $guide;

public function __construct(string $environment, bool $debug, string $guide = null)
public function __construct(string $environment, bool $debug, ?string $guide = null)
{
parent::__construct($environment, $debug);

Expand Down Expand Up @@ -118,7 +118,7 @@ private function configureContainer(ContainerConfigurator $container, LoaderInte
}
}

public function request(Request $request = null): Response
public function request(?Request $request = null): Response
{
if (null === $request && \function_exists('App\Playground\request')) {
$request = request();
Expand Down
2 changes: 1 addition & 1 deletion src/Action/EntrypointAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(
/**
* @return Entrypoint|Response
*/
public function __invoke(Request $request = null)
public function __invoke(?Request $request = null)
{
if ($this->provider && $this->processor) {
$context = ['request' => $request];
Expand Down
2 changes: 1 addition & 1 deletion src/Action/ExceptionAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ final class ExceptionAction
* @param array $errorFormats A list of enabled error formats
* @param array $exceptionToStatus A list of exceptions mapped to their HTTP status code
*/
public function __construct(private readonly SerializerInterface $serializer, private readonly array $errorFormats, private readonly array $exceptionToStatus = [], ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory = null)
public function __construct(private readonly SerializerInterface $serializer, private readonly array $errorFormats, private readonly array $exceptionToStatus = [], ?ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory = null)
{
$this->resourceMetadataCollectionFactory = $resourceMetadataCollectionFactory;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Api/FilterLocatorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private function setFilterLocator(?ContainerInterface $filterLocator, bool $allo
/**
* Gets a filter with a backward compatibility.
*/
private function getFilter(string $filterId): null|FilterInterface|MetadataFilterInterface
private function getFilter(string $filterId): FilterInterface|MetadataFilterInterface|null
{
if ($this->filterLocator && $this->filterLocator->has($filterId)) {
return $this->filterLocator->get($filterId);
Expand Down
6 changes: 3 additions & 3 deletions src/Api/IdentifiersExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final class IdentifiersExtractor implements IdentifiersExtractorInterface
use ResourceClassInfoTrait;
private readonly PropertyAccessorInterface $propertyAccessor;

public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory, ResourceClassResolverInterface $resourceClassResolver, private readonly PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, private readonly PropertyMetadataFactoryInterface $propertyMetadataFactory, PropertyAccessorInterface $propertyAccessor = null)
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory, ResourceClassResolverInterface $resourceClassResolver, private readonly PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, private readonly PropertyMetadataFactoryInterface $propertyMetadataFactory, ?PropertyAccessorInterface $propertyAccessor = null)
{
$this->resourceMetadataFactory = $resourceMetadataFactory;
$this->resourceClassResolver = $resourceClassResolver;
Expand All @@ -49,7 +49,7 @@ public function __construct(ResourceMetadataCollectionFactoryInterface $resource
*
* TODO: 3.0 identifiers should be stringable?
*/
public function getIdentifiersFromItem(object $item, Operation $operation = null, array $context = []): array
public function getIdentifiersFromItem(object $item, ?Operation $operation = null, array $context = []): array
{
if (!$this->isResourceClass($this->getObjectClass($item))) {
return ['id' => $this->propertyAccessor->getValue($item, 'id')];
Expand Down Expand Up @@ -96,7 +96,7 @@ private function getIdentifiersFromOperation(object $item, Operation $operation,
/**
* Gets the value of the given class property.
*/
private function getIdentifierValue(object $item, string $class, string $property, string $parameterName, string $toProperty = null): float|bool|int|string
private function getIdentifierValue(object $item, string $class, string $property, string $parameterName, ?string $toProperty = null): float|bool|int|string
{
if ($item instanceof $class) {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/Api/IdentifiersExtractorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ interface IdentifiersExtractorInterface
*
* @throws RuntimeException
*/
public function getIdentifiersFromItem(object $item, Operation $operation = null, array $context = []): array;
public function getIdentifiersFromItem(object $item, ?Operation $operation = null, array $context = []): array;
}
4 changes: 2 additions & 2 deletions src/Api/IriConverterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface IriConverterInterface
* @throws InvalidArgumentException
* @throws ItemNotFoundException
*/
public function getResourceFromIri(string $iri, array $context = [], Operation $operation = null): object;
public function getResourceFromIri(string $iri, array $context = [], ?Operation $operation = null): object;

/**
* Gets the IRI associated with the given item.
Expand All @@ -41,5 +41,5 @@ public function getResourceFromIri(string $iri, array $context = [], Operation $
* @throws InvalidArgumentException
* @throws RuntimeException
*/
public function getIriFromResource(object|string $resource, int $referenceType = UrlGeneratorInterface::ABS_PATH, Operation $operation = null, array $context = []): ?string;
public function getIriFromResource(object|string $resource, int $referenceType = UrlGeneratorInterface::ABS_PATH, ?Operation $operation = null, array $context = []): ?string;
}
2 changes: 1 addition & 1 deletion src/Api/ResourceClassResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(private readonly ResourceNameCollectionFactoryInterf
/**
* {@inheritdoc}
*/
public function getResourceClass(mixed $value, string $resourceClass = null, bool $strict = false): string
public function getResourceClass(mixed $value, ?string $resourceClass = null, bool $strict = false): string
{
if ($strict && null === $resourceClass) {
throw new InvalidArgumentException('Strict checking is only possible when resource class is specified.');
Expand Down
2 changes: 1 addition & 1 deletion src/Api/ResourceClassResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface ResourceClassResolverInterface
*
* @throws InvalidArgumentException
*/
public function getResourceClass(mixed $value, string $resourceClass = null, bool $strict = false): string;
public function getResourceClass(mixed $value, ?string $resourceClass = null, bool $strict = false): string;

/**
* Is the given class a resource class?
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Common/Filter/NumericFilterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function getDescription(string $resourceClass): array
/**
* Gets the PHP type corresponding to this Doctrine type.
*/
abstract protected function getType(string $doctrineType = null): string;
abstract protected function getType(?string $doctrineType = null): string;

abstract protected function getProperties(): ?array;

Expand Down
4 changes: 2 additions & 2 deletions src/Doctrine/Common/Filter/SearchFilterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ trait SearchFilterTrait

protected IriConverterInterface|LegacyIriConverterInterface $iriConverter;
protected PropertyAccessorInterface $propertyAccessor;
protected null|IdentifiersExtractorInterface|LegacyIdentifiersExtractorInterface $identifiersExtractor = null;
protected IdentifiersExtractorInterface|LegacyIdentifiersExtractorInterface|null $identifiersExtractor = null;

/**
* {@inheritdoc}
Expand Down Expand Up @@ -165,7 +165,7 @@ protected function normalizeValues(array $values, string $property): ?array
/**
* When the field should be an integer, check that the given value is a valid one.
*/
protected function hasValidValues(array $values, string $type = null): bool
protected function hasValidValues(array $values, ?string $type = null): bool
{
foreach ($values as $value) {
if (null !== $value && \in_array($type, (array) self::DOCTRINE_INTEGER_TYPE, true) && false === filter_var($value, \FILTER_VALIDATE_INT)) {
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 @@ -90,7 +90,7 @@ private function getLinks(string $resourceClass, Operation $operation, array $co
return [$newLink];
}

private function getIdentifierValue(array &$identifiers, string $name = null): mixed
private function getIdentifierValue(array &$identifiers, ?string $name = null): mixed
{
if (isset($identifiers[$name])) {
$value = $identifiers[$name];
Expand All @@ -102,7 +102,7 @@ private function getIdentifierValue(array &$identifiers, string $name = null): m
return array_shift($identifiers);
}

private function getOperationLinks(Operation $operation = null): array
private function getOperationLinks(?Operation $operation = null): array
{
if ($operation instanceof GraphQlOperation) {
return $operation->getLinks() ?? [];
Expand Down
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,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
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ final class PublishMercureUpdatesListener
/**
* @param array<string, string[]|string> $formats
*/
public function __construct(LegacyResourceClassResolverInterface|ResourceClassResolverInterface $resourceClassResolver, private readonly LegacyIriConverterInterface|IriConverterInterface $iriConverter, ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory, private readonly SerializerInterface $serializer, private readonly array $formats, MessageBusInterface $messageBus = null, private readonly ?HubRegistry $hubRegistry = null, private readonly ?GraphQlSubscriptionManagerInterface $graphQlSubscriptionManager = null, private readonly ?GraphQlMercureSubscriptionIriGeneratorInterface $graphQlMercureSubscriptionIriGenerator = null, ExpressionLanguage $expressionLanguage = null, private bool $includeType = false)
public function __construct(LegacyResourceClassResolverInterface|ResourceClassResolverInterface $resourceClassResolver, private readonly LegacyIriConverterInterface|IriConverterInterface $iriConverter, ResourceMetadataCollectionFactoryInterface $resourceMetadataFactory, private readonly SerializerInterface $serializer, private readonly array $formats, ?MessageBusInterface $messageBus = null, private readonly ?HubRegistry $hubRegistry = null, private readonly ?GraphQlSubscriptionManagerInterface $graphQlSubscriptionManager = null, private readonly ?GraphQlMercureSubscriptionIriGeneratorInterface $graphQlMercureSubscriptionIriGenerator = null, ?ExpressionLanguage $expressionLanguage = null, private bool $includeType = false)
{
if (null === $messageBus && null === $hubRegistry) {
throw new InvalidArgumentException('A message bus or a hub registry must be provided.');
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/EventListener/PurgeHttpCacheListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ final class PurgeHttpCacheListener
private readonly PropertyAccessorInterface $propertyAccessor;
private array $tags = [];

public function __construct(private readonly PurgerInterface $purger, private readonly IriConverterInterface|LegacyIriConverterInterface $iriConverter, private readonly ResourceClassResolverInterface|LegacyResourceClassResolverInterface $resourceClassResolver, PropertyAccessorInterface $propertyAccessor = null)
public function __construct(private readonly PurgerInterface $purger, private readonly IriConverterInterface|LegacyIriConverterInterface $iriConverter, private readonly ResourceClassResolverInterface|LegacyResourceClassResolverInterface $resourceClassResolver, ?PropertyAccessorInterface $propertyAccessor = null)
{
$this->propertyAccessor = $propertyAccessor ?? PropertyAccess::createPropertyAccessor();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
*/
interface AggregationCollectionExtensionInterface
{
public function applyToCollection(Builder $aggregationBuilder, string $resourceClass, Operation $operation = null, array &$context = []): void;
public function applyToCollection(Builder $aggregationBuilder, string $resourceClass, ?Operation $operation = null, array &$context = []): void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
*/
interface AggregationItemExtensionInterface
{
public function applyToItem(Builder $aggregationBuilder, string $resourceClass, array $identifiers, Operation $operation = null, array &$context = []): void;
public function applyToItem(Builder $aggregationBuilder, string $resourceClass, array $identifiers, ?Operation $operation = null, array &$context = []): void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
interface AggregationResultCollectionExtensionInterface extends AggregationCollectionExtensionInterface
{
public function supportsResult(string $resourceClass, Operation $operation = null, array $context = []): bool;
public function supportsResult(string $resourceClass, ?Operation $operation = null, array $context = []): bool;

public function getResult(Builder $aggregationBuilder, string $resourceClass, Operation $operation = null, array $context = []): iterable;
public function getResult(Builder $aggregationBuilder, string $resourceClass, ?Operation $operation = null, array $context = []): iterable;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
interface AggregationResultItemExtensionInterface extends AggregationItemExtensionInterface
{
public function supportsResult(string $resourceClass, Operation $operation = null, array $context = []): bool;
public function supportsResult(string $resourceClass, ?Operation $operation = null, array $context = []): bool;

public function getResult(Builder $aggregationBuilder, string $resourceClass, Operation $operation = null, array $context = []): ?object;
public function getResult(Builder $aggregationBuilder, string $resourceClass, ?Operation $operation = null, array $context = []): ?object;
}
2 changes: 1 addition & 1 deletion src/Doctrine/Odm/Extension/FilterExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct(private readonly ContainerInterface $filterLocator)
/**
* {@inheritdoc}
*/
public function applyToCollection(Builder $aggregationBuilder, string $resourceClass, Operation $operation = null, array &$context = []): void
public function applyToCollection(Builder $aggregationBuilder, string $resourceClass, ?Operation $operation = null, array &$context = []): void
{
$resourceFilters = $operation?->getFilters();

Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Odm/Extension/OrderExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct(private readonly ?string $order = null, private read
/**
* {@inheritdoc}
*/
public function applyToCollection(Builder $aggregationBuilder, string $resourceClass, Operation $operation = null, array &$context = []): void
public function applyToCollection(Builder $aggregationBuilder, string $resourceClass, ?Operation $operation = null, array &$context = []): void
{
// Do not apply order if already defined on $aggregationBuilder
if ($this->hasSortStage($aggregationBuilder)) {
Expand Down
6 changes: 3 additions & 3 deletions src/Doctrine/Odm/Extension/PaginationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct(private readonly ManagerRegistry $managerRegistry, p
*
* @throws RuntimeException
*/
public function applyToCollection(Builder $aggregationBuilder, string $resourceClass, Operation $operation = null, array &$context = []): void
public function applyToCollection(Builder $aggregationBuilder, string $resourceClass, ?Operation $operation = null, array &$context = []): void
{
if (!$this->pagination->isEnabled($operation, $context)) {
return;
Expand Down Expand Up @@ -85,7 +85,7 @@ public function applyToCollection(Builder $aggregationBuilder, string $resourceC
/**
* {@inheritdoc}
*/
public function supportsResult(string $resourceClass, Operation $operation = null, array $context = []): bool
public function supportsResult(string $resourceClass, ?Operation $operation = null, array $context = []): bool
{
if ($context['graphql_operation_name'] ?? false) {
return $this->pagination->isGraphQlEnabled($operation, $context);
Expand All @@ -99,7 +99,7 @@ public function supportsResult(string $resourceClass, Operation $operation = nul
*
* @throws RuntimeException
*/
public function getResult(Builder $aggregationBuilder, string $resourceClass, Operation $operation = null, array $context = []): iterable
public function getResult(Builder $aggregationBuilder, string $resourceClass, ?Operation $operation = null, array $context = []): iterable
{
$manager = $this->managerRegistry->getManagerForClass($resourceClass);
if (!$manager instanceof DocumentManager) {
Expand Down
6 changes: 3 additions & 3 deletions src/Doctrine/Odm/Filter/AbstractFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ abstract class AbstractFilter implements FilterInterface
use PropertyHelperTrait;
protected LoggerInterface $logger;

public function __construct(protected ManagerRegistry $managerRegistry, LoggerInterface $logger = null, protected ?array $properties = null, protected ?NameConverterInterface $nameConverter = null)
public function __construct(protected ManagerRegistry $managerRegistry, ?LoggerInterface $logger = null, protected ?array $properties = null, protected ?NameConverterInterface $nameConverter = null)
{
$this->logger = $logger ?? new NullLogger();
}

/**
* {@inheritdoc}
*/
public function apply(Builder $aggregationBuilder, string $resourceClass, Operation $operation = null, array &$context = []): void
public function apply(Builder $aggregationBuilder, string $resourceClass, ?Operation $operation = null, array &$context = []): void
{
foreach ($context['filters'] as $property => $value) {
$this->filterProperty($this->denormalizePropertyName($property), $value, $aggregationBuilder, $resourceClass, $operation, $context);
Expand All @@ -53,7 +53,7 @@ public function apply(Builder $aggregationBuilder, string $resourceClass, Operat
/**
* Passes a property through the filter.
*/
abstract protected function filterProperty(string $property, $value, Builder $aggregationBuilder, string $resourceClass, Operation $operation = null, array &$context = []): void;
abstract protected function filterProperty(string $property, $value, Builder $aggregationBuilder, string $resourceClass, ?Operation $operation = null, array &$context = []): void;

protected function getManagerRegistry(): ManagerRegistry
{
Expand Down
Loading

0 comments on commit 86be7df

Please sign in to comment.