From be8fbe17a3fd2579d7fdc7b88f681be88e088a1d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 23 Mar 2024 10:27:59 +0000 Subject: [PATCH 1/2] chore(deps): update dependency friendsofphp/php-cs-fixer to v3.52.1 --- api/composer.json | 2 +- api/composer.lock | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/api/composer.json b/api/composer.json index 4271644e0e..925ef4e2cd 100644 --- a/api/composer.json +++ b/api/composer.json @@ -48,7 +48,7 @@ "webonyx/graphql-php": "15.11.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "3.49.0", + "friendsofphp/php-cs-fixer": "3.52.1", "hautelook/alice-bundle": "2.13.0", "justinrainbow/json-schema": "5.2.13", "php-coveralls/php-coveralls": "2.7.0", diff --git a/api/composer.lock b/api/composer.lock index a6c892094c..592826f5a1 100644 --- a/api/composer.lock +++ b/api/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "74b050a03a179193060dd24d8fa10031", + "content-hash": "05454371ab34647e2aae49bb74dfb045", "packages": [ { "name": "api-platform/core", @@ -10867,16 +10867,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.49.0", + "version": "v3.52.1", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "8742f7aa6f72a399688b65e4f58992c2d4681fc2" + "reference": "6e77207f0d851862ceeb6da63e6e22c01b1587bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/8742f7aa6f72a399688b65e4f58992c2d4681fc2", - "reference": "8742f7aa6f72a399688b65e4f58992c2d4681fc2", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/6e77207f0d851862ceeb6da63e6e22c01b1587bc", + "reference": "6e77207f0d851862ceeb6da63e6e22c01b1587bc", "shasum": "" }, "require": { @@ -10886,7 +10886,7 @@ "ext-json": "*", "ext-tokenizer": "*", "php": "^7.4 || ^8.0", - "sebastian/diff": "^4.0 || ^5.0", + "sebastian/diff": "^4.0 || ^5.0 || ^6.0", "symfony/console": "^5.4 || ^6.0 || ^7.0", "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", @@ -10907,7 +10907,8 @@ "php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", - "phpunit/phpunit": "^9.6 || ^10.5.5", + "phpunit/phpunit": "^9.6 || ^10.5.5 || ^11.0.2", + "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", "symfony/yaml": "^5.4 || ^6.0 || ^7.0" }, "suggest": { @@ -10946,7 +10947,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.49.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.52.1" }, "funding": [ { @@ -10954,7 +10955,7 @@ "type": "github" } ], - "time": "2024-02-02T00:41:40+00:00" + "time": "2024-03-19T21:02:43+00:00" }, { "name": "hautelook/alice-bundle", From 7e9fbbb603b1bbccd7aea1c5c7399a22d5bc0781 Mon Sep 17 00:00:00 2001 From: Urban Suppiger Date: Sun, 24 Mar 2024 12:33:18 +0800 Subject: [PATCH 2/2] run cs-fix --- api/src/Doctrine/Filter/ContentNodePeriodFilter.php | 8 ++++---- api/src/Doctrine/Filter/ExpressionDateTimeFilter.php | 2 +- api/src/Doctrine/Filter/MaterialItemPeriodFilter.php | 8 ++++---- api/src/Doctrine/FilterByCurrentUserExtension.php | 4 ++-- api/src/Entity/CampCollaboration.php | 2 +- api/src/Entity/ScheduleEntry.php | 4 ++-- .../Serializer/Denormalizer/InputFilterDenormalizer.php | 2 +- .../Serializer/Denormalizer/MaterialItemDenormalizer.php | 2 +- .../CircularReferenceDetectingHalItemNormalizer.php | 4 ++-- .../TranslationConstraintViolationListNormalizer.php | 6 +++--- api/src/State/PeriodPersistProcessor.php | 2 +- api/src/Util/GetCampFromContentNodeTrait.php | 4 ++-- .../Validator/AllowTransition/AssertAllowTransitions.php | 4 ++-- .../AllowTransition/AssertAllowTransitionsValidator.php | 2 +- api/src/Validator/AssertBelongsToSameCamp.php | 2 +- api/src/Validator/AssertContainsAtLeastOneManager.php | 2 +- api/src/Validator/AssertEitherIsNull.php | 2 +- api/src/Validator/AssertJsonSchema.php | 2 +- .../Validator/AssertLastCollectionItemIsNotDeleted.php | 6 +++--- .../Validator/ColumnLayout/AssertColumWidthsSumTo12.php | 2 +- api/src/Validator/ColumnLayout/AssertNoOrphanChildren.php | 2 +- .../Validator/ContentNode/AssertSlotSupportedByParent.php | 4 ++-- api/tests/Api/ECampApiTestCase.php | 2 +- ...onConstraintViolationListNormalizerIntegrationTest.php | 4 ++-- 24 files changed, 41 insertions(+), 41 deletions(-) diff --git a/api/src/Doctrine/Filter/ContentNodePeriodFilter.php b/api/src/Doctrine/Filter/ContentNodePeriodFilter.php index 15c9ff5beb..62a13c7147 100644 --- a/api/src/Doctrine/Filter/ContentNodePeriodFilter.php +++ b/api/src/Doctrine/Filter/ContentNodePeriodFilter.php @@ -21,9 +21,9 @@ final class ContentNodePeriodFilter extends AbstractFilter { public function __construct( private IriConverterInterface $iriConverter, ManagerRegistry $managerRegistry, - LoggerInterface $logger = null, - array $properties = null, - NameConverterInterface $nameConverter = null + ?LoggerInterface $logger = null, + ?array $properties = null, + ?NameConverterInterface $nameConverter = null ) { parent::__construct($managerRegistry, $logger, $properties, $nameConverter); } @@ -46,7 +46,7 @@ protected function filterProperty( QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, - Operation $operation = null, + ?Operation $operation = null, array $context = [] ): void { if (ContentNode::class !== $resourceClass) { diff --git a/api/src/Doctrine/Filter/ExpressionDateTimeFilter.php b/api/src/Doctrine/Filter/ExpressionDateTimeFilter.php index ce9d060c3a..7b99c5411f 100644 --- a/api/src/Doctrine/Filter/ExpressionDateTimeFilter.php +++ b/api/src/Doctrine/Filter/ExpressionDateTimeFilter.php @@ -51,7 +51,7 @@ protected function filterProperty( QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, - Operation $operation = null, + ?Operation $operation = null, array $context = [] ): void { if ( diff --git a/api/src/Doctrine/Filter/MaterialItemPeriodFilter.php b/api/src/Doctrine/Filter/MaterialItemPeriodFilter.php index 9ce14a4ac3..16495407c5 100644 --- a/api/src/Doctrine/Filter/MaterialItemPeriodFilter.php +++ b/api/src/Doctrine/Filter/MaterialItemPeriodFilter.php @@ -23,9 +23,9 @@ final class MaterialItemPeriodFilter extends AbstractFilter { public function __construct( private IriConverterInterface $iriConverter, ManagerRegistry $managerRegistry, - LoggerInterface $logger = null, - array $properties = null, - NameConverterInterface $nameConverter = null + ?LoggerInterface $logger = null, + ?array $properties = null, + ?NameConverterInterface $nameConverter = null ) { parent::__construct($managerRegistry, $logger, $properties, $nameConverter); } @@ -48,7 +48,7 @@ protected function filterProperty( QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, - Operation $operation = null, + ?Operation $operation = null, array $context = [] ): void { if (MaterialItem::class !== $resourceClass) { diff --git a/api/src/Doctrine/FilterByCurrentUserExtension.php b/api/src/Doctrine/FilterByCurrentUserExtension.php index 373cb01672..2f34eaa963 100644 --- a/api/src/Doctrine/FilterByCurrentUserExtension.php +++ b/api/src/Doctrine/FilterByCurrentUserExtension.php @@ -21,11 +21,11 @@ public function __construct(Security $security, EntityManagerInterface $entityMa $this->entityManager = $entityManager; } - public function applyToCollection(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass = null, Operation $operation = null, array $context = []): void { + public function applyToCollection(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, ?string $resourceClass = null, ?Operation $operation = null, array $context = []): void { $this->addWhere($queryBuilder, $resourceClass); } - public function applyToItem(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, array $identifiers, Operation $operation = null, array $context = []): void { + public function applyToItem(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, array $identifiers, ?Operation $operation = null, array $context = []): void { $this->addWhere($queryBuilder, $resourceClass); } diff --git a/api/src/Entity/CampCollaboration.php b/api/src/Entity/CampCollaboration.php index fc12c76597..d26edbe1fb 100644 --- a/api/src/Entity/CampCollaboration.php +++ b/api/src/Entity/CampCollaboration.php @@ -298,7 +298,7 @@ public function removeDayResponsible(DayResponsible $dayResponsible): self { /** * Returns user's email, fallback to inviteEmail if user not yet known (pending email invitation). */ - public function getEmail(): null|string { + public function getEmail(): ?string { return $this->user?->getEmail() ?? $this->inviteEmail; } } diff --git a/api/src/Entity/ScheduleEntry.php b/api/src/Entity/ScheduleEntry.php index 07f6fa5689..0907ad65f3 100644 --- a/api/src/Entity/ScheduleEntry.php +++ b/api/src/Entity/ScheduleEntry.php @@ -139,7 +139,7 @@ public function getCamp(): ?Camp { return $this->activity?->getCamp(); } - public function getPeriod(): null|Period { + public function getPeriod(): ?Period { return $this->period; } @@ -221,7 +221,7 @@ public function getEmbeddedActivity(): ?Activity { */ #[ApiProperty(writable: false, example: '/days/1a2b3c4d')] #[Groups(['read'])] - public function getDay(): null|Day { + public function getDay(): ?Day { $dayOffset = $this->getDayOffset(); $filteredDays = $this->period->days->filter(function (Day $day) use ($dayOffset) { diff --git a/api/src/Serializer/Denormalizer/InputFilterDenormalizer.php b/api/src/Serializer/Denormalizer/InputFilterDenormalizer.php index 706c6fbe4a..26ccb8634c 100644 --- a/api/src/Serializer/Denormalizer/InputFilterDenormalizer.php +++ b/api/src/Serializer/Denormalizer/InputFilterDenormalizer.php @@ -42,7 +42,7 @@ public function denormalize($data, $type, $format = null, array $context = []): /** * {@inheritdoc} */ - public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool { + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { // Make sure we don't run this denormalizer twice. if (isset($context[self::ALREADY_CALLED])) { return false; diff --git a/api/src/Serializer/Denormalizer/MaterialItemDenormalizer.php b/api/src/Serializer/Denormalizer/MaterialItemDenormalizer.php index 22eda1e36a..67cf6369d6 100644 --- a/api/src/Serializer/Denormalizer/MaterialItemDenormalizer.php +++ b/api/src/Serializer/Denormalizer/MaterialItemDenormalizer.php @@ -41,7 +41,7 @@ public function denormalize($data, $type, $format = null, array $context = []): /** * {@inheritdoc} */ - public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool { + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { // Make sure we don't run this denormalizer twice. if (isset($context[self::ALREADY_CALLED])) { return false; diff --git a/api/src/Serializer/Normalizer/CircularReferenceDetectingHalItemNormalizer.php b/api/src/Serializer/Normalizer/CircularReferenceDetectingHalItemNormalizer.php index 9c0b724d0c..2cd0d4ddee 100644 --- a/api/src/Serializer/Normalizer/CircularReferenceDetectingHalItemNormalizer.php +++ b/api/src/Serializer/Normalizer/CircularReferenceDetectingHalItemNormalizer.php @@ -24,7 +24,7 @@ final class CircularReferenceDetectingHalItemNormalizer extends AbstractItemNorm */ protected const HAL_CIRCULAR_REFERENCE_LIMIT_COUNTERS = 'hal_circular_reference_limit_counters'; - public function __construct(private NormalizerInterface $decorated, PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, PropertyMetadataFactoryInterface $propertyMetadataFactory, IriConverterInterface $iriConverter, ResourceClassResolverInterface $resourceClassResolver, PropertyAccessorInterface $propertyAccessor = null, NameConverterInterface $nameConverter = null, ClassMetadataFactoryInterface $classMetadataFactory = null, array $defaultContext = [], ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory = null, ?ResourceAccessCheckerInterface $resourceAccessChecker = null) { + public function __construct(private NormalizerInterface $decorated, PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, PropertyMetadataFactoryInterface $propertyMetadataFactory, IriConverterInterface $iriConverter, ResourceClassResolverInterface $resourceClassResolver, ?PropertyAccessorInterface $propertyAccessor = null, ?NameConverterInterface $nameConverter = null, ?ClassMetadataFactoryInterface $classMetadataFactory = null, array $defaultContext = [], ?ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory = null, ?ResourceAccessCheckerInterface $resourceAccessChecker = null) { $defaultContext[AbstractNormalizer::CIRCULAR_REFERENCE_HANDLER] = function ($object) { return ['_links' => ['self' => ['href' => $this->iriConverter->getIriFromResource($object)]]]; }; @@ -91,7 +91,7 @@ protected function isHalCircularReference(object $object, array &$context) { * * @throws CircularReferenceException */ - protected function handleHalCircularReference(object $object, string $format = null, array $context = []) { + protected function handleHalCircularReference(object $object, ?string $format = null, array $context = []) { $circularReferenceHandler = $context[AbstractNormalizer::CIRCULAR_REFERENCE_HANDLER] ?? $this->defaultContext[AbstractNormalizer::CIRCULAR_REFERENCE_HANDLER]; if ($circularReferenceHandler) { return $circularReferenceHandler($object, $format, $context); diff --git a/api/src/Serializer/Normalizer/TranslationConstraintViolationListNormalizer.php b/api/src/Serializer/Normalizer/TranslationConstraintViolationListNormalizer.php index 70d83d4010..55063bd2b3 100644 --- a/api/src/Serializer/Normalizer/TranslationConstraintViolationListNormalizer.php +++ b/api/src/Serializer/Normalizer/TranslationConstraintViolationListNormalizer.php @@ -20,11 +20,11 @@ public function __construct( private readonly TranslateToAllLocalesService $translateToAllLocalesService ) {} - public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool { + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { return $this->getNormalizerCollection()->exists(fn ($_, $elem) => $elem->supportsNormalization($data, $format, $context)); } - public function normalize(mixed $object, string $format = null, array $context = []): null|array|\ArrayObject|bool|float|int|string { + public function normalize(mixed $object, ?string $format = null, array $context = []): null|array|\ArrayObject|bool|float|int|string { $normalizer = $this->getNormalizerCollection()->filter(fn ($elem) => $elem->supportsNormalization($object, $format, $context))->first(); if (false === $normalizer) { throw new \RuntimeException("Did not find a normalizer to normalize response to format {$format}"); @@ -75,7 +75,7 @@ public function getSupportedTypes(?string $format): array { ->map(function (AbstractConstraintViolationListNormalizer $normalizer) use ($format) { return $normalizer->getSupportedTypes($format); }) - ->reduce(fn (null|array $left, array $right) => array_merge($left ?? [], $right), []) + ->reduce(fn (?array $left, array $right) => array_merge($left ?? [], $right), []) ; } diff --git a/api/src/State/PeriodPersistProcessor.php b/api/src/State/PeriodPersistProcessor.php index d0b6c50370..7bfdd862d4 100644 --- a/api/src/State/PeriodPersistProcessor.php +++ b/api/src/State/PeriodPersistProcessor.php @@ -30,7 +30,7 @@ public function onBefore($data, Operation $operation, array $uriVariables = [], return $data; } - public static function moveDaysAndScheduleEntries(Period $period, Period $originalPeriod = null) { + public static function moveDaysAndScheduleEntries(Period $period, ?Period $originalPeriod = null) { if (!$originalPeriod) { return; } diff --git a/api/src/Util/GetCampFromContentNodeTrait.php b/api/src/Util/GetCampFromContentNodeTrait.php index 1ae9a48448..f7128624f7 100644 --- a/api/src/Util/GetCampFromContentNodeTrait.php +++ b/api/src/Util/GetCampFromContentNodeTrait.php @@ -10,7 +10,7 @@ use Doctrine\ORM\EntityManagerInterface; trait GetCampFromContentNodeTrait { - private function getCampFromInterface(mixed $subject, EntityManagerInterface $em): null|Camp { + private function getCampFromInterface(mixed $subject, EntityManagerInterface $em): ?Camp { if ($subject instanceof BelongsToCampInterface) { return $subject->getCamp(); } @@ -22,7 +22,7 @@ private function getCampFromInterface(mixed $subject, EntityManagerInterface $em return null; } - private function getCampFromContentNode(BelongsToContentNodeTreeInterface $subject, EntityManagerInterface $em): null|Camp { + private function getCampFromContentNode(BelongsToContentNodeTreeInterface $subject, EntityManagerInterface $em): ?Camp { $rootContentNode = $subject->getRoot(); $activity = $em diff --git a/api/src/Validator/AllowTransition/AssertAllowTransitions.php b/api/src/Validator/AllowTransition/AssertAllowTransitions.php index 4bd3b4924e..085e8fe0ee 100644 --- a/api/src/Validator/AllowTransition/AssertAllowTransitions.php +++ b/api/src/Validator/AllowTransition/AssertAllowTransitions.php @@ -15,8 +15,8 @@ class AssertAllowTransitions extends Constraint { public function __construct( public array $transitions, - array $options = null, - array $groups = null, + ?array $options = null, + ?array $groups = null, $payload = null ) { parent::__construct($options ?? [], $groups, $payload); diff --git a/api/src/Validator/AllowTransition/AssertAllowTransitionsValidator.php b/api/src/Validator/AllowTransition/AssertAllowTransitionsValidator.php index c9ec21c4bb..01e4624b45 100644 --- a/api/src/Validator/AllowTransition/AssertAllowTransitionsValidator.php +++ b/api/src/Validator/AllowTransition/AssertAllowTransitionsValidator.php @@ -12,7 +12,7 @@ class AssertAllowTransitionsValidator extends ConstraintValidator { public const TO_VIOLATION_MESSAGE = 'value must be one of {{ to }}, was {{ value }}'; public const FROM_VIOLATION_MESSAGE = 'This value was previously in an unexpected state,'. - ' expected one of {{ from }}, but was {{ previousValue }}'; + ' expected one of {{ from }}, but was {{ previousValue }}'; public function __construct(public RequestStack $requestStack) {} diff --git a/api/src/Validator/AssertBelongsToSameCamp.php b/api/src/Validator/AssertBelongsToSameCamp.php index 7bd51a90bd..d8021caa8e 100644 --- a/api/src/Validator/AssertBelongsToSameCamp.php +++ b/api/src/Validator/AssertBelongsToSameCamp.php @@ -14,7 +14,7 @@ class AssertBelongsToSameCamp extends Constraint { * * @param bool $compareToPrevious in case the camp getter considers the annotated property, use this option (only when updating) */ - public function __construct(array $options = null, bool $compareToPrevious = false, string $message = null, array $groups = null, mixed $payload = null) { + public function __construct(?array $options = null, bool $compareToPrevious = false, ?string $message = null, ?array $groups = null, mixed $payload = null) { parent::__construct($options ?? [], $groups, $payload); $this->message = $message ?? $this->message; diff --git a/api/src/Validator/AssertContainsAtLeastOneManager.php b/api/src/Validator/AssertContainsAtLeastOneManager.php index a7018fc565..8f95da53dc 100644 --- a/api/src/Validator/AssertContainsAtLeastOneManager.php +++ b/api/src/Validator/AssertContainsAtLeastOneManager.php @@ -8,7 +8,7 @@ class AssertContainsAtLeastOneManager extends Constraint { public string $message = 'must have at least one manager.'; - public function __construct(array $options = null, array $groups = null, $payload = null) { + public function __construct(?array $options = null, ?array $groups = null, $payload = null) { parent::__construct($options ?? [], $groups, $payload); } } diff --git a/api/src/Validator/AssertEitherIsNull.php b/api/src/Validator/AssertEitherIsNull.php index c514412959..0575e795d1 100644 --- a/api/src/Validator/AssertEitherIsNull.php +++ b/api/src/Validator/AssertEitherIsNull.php @@ -11,7 +11,7 @@ class AssertEitherIsNull extends Constraint { public string $messageNoneNull = 'Either this value or {{ other }} should be null.'; public string $other; - public function __construct(array $options = null, string $other = null, string $messageBothNull = null, string $messageNoneNull = null, array $groups = null, $payload = null) { + public function __construct(?array $options = null, ?string $other = null, ?string $messageBothNull = null, ?string $messageNoneNull = null, ?array $groups = null, $payload = null) { parent::__construct($options ?? [], $groups, $payload); $this->messageBothNull = $messageBothNull ?? $this->messageBothNull; diff --git a/api/src/Validator/AssertJsonSchema.php b/api/src/Validator/AssertJsonSchema.php index 81e9286f54..67b8c8c94e 100644 --- a/api/src/Validator/AssertJsonSchema.php +++ b/api/src/Validator/AssertJsonSchema.php @@ -12,7 +12,7 @@ class AssertJsonSchema extends Constraint { 'type' => 'object', ]; - public function __construct(array $options = null, string $message = null, array $schema = null, array $groups = null, $payload = null) { + public function __construct(?array $options = null, ?string $message = null, ?array $schema = null, ?array $groups = null, $payload = null) { parent::__construct($options ?? [], $groups, $payload); $this->message = $message ?? $this->message; diff --git a/api/src/Validator/AssertLastCollectionItemIsNotDeleted.php b/api/src/Validator/AssertLastCollectionItemIsNotDeleted.php index b27a3787c8..86d5344e35 100644 --- a/api/src/Validator/AssertLastCollectionItemIsNotDeleted.php +++ b/api/src/Validator/AssertLastCollectionItemIsNotDeleted.php @@ -10,9 +10,9 @@ class AssertLastCollectionItemIsNotDeleted extends Constraint { public string $message = 'Cannot delete the last entry.'; public function __construct( - array $options = null, - string $message = null, - array $groups = null, + ?array $options = null, + ?string $message = null, + ?array $groups = null, mixed $payload = null ) { parent::__construct($options ?? [], $groups, $payload); diff --git a/api/src/Validator/ColumnLayout/AssertColumWidthsSumTo12.php b/api/src/Validator/ColumnLayout/AssertColumWidthsSumTo12.php index 5a7111256a..358db84103 100644 --- a/api/src/Validator/ColumnLayout/AssertColumWidthsSumTo12.php +++ b/api/src/Validator/ColumnLayout/AssertColumWidthsSumTo12.php @@ -8,7 +8,7 @@ class AssertColumWidthsSumTo12 extends Constraint { public string $message = 'Expected column widths to sum to 12, but got a sum of {{ sum }}'; - public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) { + public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, $payload = null) { parent::__construct($options ?? [], $groups, $payload); $this->message = $message ?? $this->message; diff --git a/api/src/Validator/ColumnLayout/AssertNoOrphanChildren.php b/api/src/Validator/ColumnLayout/AssertNoOrphanChildren.php index 0d441893d7..928902c1fa 100644 --- a/api/src/Validator/ColumnLayout/AssertNoOrphanChildren.php +++ b/api/src/Validator/ColumnLayout/AssertNoOrphanChildren.php @@ -8,7 +8,7 @@ class AssertNoOrphanChildren extends Constraint { public string $message = 'The following slots still have child contents and should be present in the columns: {{ slots }}'; - public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null) { + public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, $payload = null) { parent::__construct($options ?? [], $groups, $payload); $this->message = $message ?? $this->message; diff --git a/api/src/Validator/ContentNode/AssertSlotSupportedByParent.php b/api/src/Validator/ContentNode/AssertSlotSupportedByParent.php index a158cf5af1..7b28fdaff7 100644 --- a/api/src/Validator/ContentNode/AssertSlotSupportedByParent.php +++ b/api/src/Validator/ContentNode/AssertSlotSupportedByParent.php @@ -14,8 +14,8 @@ public function __construct( public readonly string $message = self::MESSAGE, public readonly string $noParentMessage = self::NO_PARENT_MESSAGE, public readonly string $parentDoesNotSupportChildrenMessage = self::PARENT_DOES_NOT_SUPPORT_CHILDREN, - array $options = null, - array $groups = null, + ?array $options = null, + ?array $groups = null, $payload = null ) { parent::__construct($options ?? [], $groups, $payload); diff --git a/api/tests/Api/ECampApiTestCase.php b/api/tests/Api/ECampApiTestCase.php index e89d1bb9d8..7ec5c7fcde 100644 --- a/api/tests/Api/ECampApiTestCase.php +++ b/api/tests/Api/ECampApiTestCase.php @@ -229,7 +229,7 @@ protected function delete(?BaseEntity $entity = null, ?User $user = null) { return static::createClientWithCredentials($credentials)->request('DELETE', $this->endpoint.'/'.$entity->getId()); } - protected function create(array $payload = null, ?User $user = null) { + protected function create(?array $payload = null, ?User $user = null) { $credentials = null; if (null !== $user) { $credentials = ['email' => $user->getEmail()]; diff --git a/api/tests/Integration/Serializer/Normalizer/TranslationConstraintViolationListNormalizerIntegrationTest.php b/api/tests/Integration/Serializer/Normalizer/TranslationConstraintViolationListNormalizerIntegrationTest.php index c4b79dd9f6..00e3849a4d 100644 --- a/api/tests/Integration/Serializer/Normalizer/TranslationConstraintViolationListNormalizerIntegrationTest.php +++ b/api/tests/Integration/Serializer/Normalizer/TranslationConstraintViolationListNormalizerIntegrationTest.php @@ -210,8 +210,8 @@ public static function getConstraintViolations(): array { class MyConstraint extends Constraint { public function __construct( - array $options = null, - array $groups = null, + ?array $options = null, + ?array $groups = null, $payload = null ) { parent::__construct($options ?? [], $groups, $payload);