From b724b05de640ab605184a277451da7bb28c4f969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sat, 8 Feb 2025 00:19:20 +0100 Subject: [PATCH] Fixed "implicitly marking parameter as nullable" deprecations in PHP 8.4 fixed --- .../AddDocumentedAPIPropertiesJSONSchemaFactory.php | 6 +++--- src/ApiPlatform/Filter/EntityFilter.php | 4 ++-- src/ApiPlatform/Filter/LikeFilter.php | 2 +- src/ApiPlatform/Filter/PartStoragelocationFilter.php | 4 ++-- src/Command/User/UserEnableCommand.php | 2 +- src/DataTables/Adapters/TwoStepORMAdapter.php | 2 +- .../Filters/Constraints/AbstractConstraint.php | 2 +- .../Filters/Constraints/BooleanConstraint.php | 2 +- .../Filters/Constraints/DateTimeConstraint.php | 2 +- .../Filters/Constraints/EntityConstraint.php | 2 +- .../Filters/Constraints/NumberConstraint.php | 2 +- .../Constraints/Part/LessThanDesiredConstraint.php | 2 +- .../Filters/Constraints/Part/TagsConstraint.php | 2 +- src/DataTables/Filters/Constraints/TextConstraint.php | 2 +- src/Entity/Base/AbstractCompany.php | 2 +- src/Entity/OAuthToken.php | 2 +- src/Migration/WithPermPresetsTrait.php | 2 +- src/Repository/LogEntryRepository.php | 2 +- src/Security/ApiTokenAuthenticator.php | 2 +- src/Security/AuthenticationEntryPoint.php | 2 +- src/Security/SamlUserFactory.php | 4 ++-- src/Serializer/AttachmentNormalizer.php | 4 ++-- src/Serializer/BigNumberNormalizer.php | 8 ++++---- src/Serializer/PartNormalizer.php | 6 +++--- src/Serializer/StructuralElementDenormalizer.php | 4 ++-- .../StructuralElementFromNameDenormalizer.php | 4 ++-- src/Serializer/StructuralElementNormalizer.php | 4 ++-- src/Services/ImportExportSystem/EntityImporter.php | 2 +- .../Providers/OEMSecretsProvider.php | 2 +- src/Validator/Constraints/UniqueObjectCollection.php | 10 +++++----- src/Validator/Constraints/ValidGoogleAuthCode.php | 4 ++-- 31 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/ApiPlatform/AddDocumentedAPIPropertiesJSONSchemaFactory.php b/src/ApiPlatform/AddDocumentedAPIPropertiesJSONSchemaFactory.php index db629a4a..07ff0f1b 100644 --- a/src/ApiPlatform/AddDocumentedAPIPropertiesJSONSchemaFactory.php +++ b/src/ApiPlatform/AddDocumentedAPIPropertiesJSONSchemaFactory.php @@ -43,9 +43,9 @@ class AddDocumentedAPIPropertiesJSONSchemaFactory implements SchemaFactoryInterf string $className, string $format = 'json', string $type = Schema::TYPE_OUTPUT, - Operation $operation = null, - Schema $schema = null, - array $serializerContext = null, + ?Operation $operation = null, + ?Schema $schema = null, + ?array $serializerContext = null, bool $forceCollection = false ): Schema { diff --git a/src/ApiPlatform/Filter/EntityFilter.php b/src/ApiPlatform/Filter/EntityFilter.php index 50c1404f..85bc3833 100644 --- a/src/ApiPlatform/Filter/EntityFilter.php +++ b/src/ApiPlatform/Filter/EntityFilter.php @@ -37,7 +37,7 @@ class EntityFilter extends AbstractFilter public function __construct( ManagerRegistry $managerRegistry, private readonly EntityFilterHelper $filter_helper, - LoggerInterface $logger = null, + ?LoggerInterface $logger = null, ?array $properties = null, ?NameConverterInterface $nameConverter = null ) { @@ -50,7 +50,7 @@ class EntityFilter extends AbstractFilter QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, - Operation $operation = null, + ?Operation $operation = null, array $context = [] ): void { if ( diff --git a/src/ApiPlatform/Filter/LikeFilter.php b/src/ApiPlatform/Filter/LikeFilter.php index 08fc1b3a..a70cfd9e 100644 --- a/src/ApiPlatform/Filter/LikeFilter.php +++ b/src/ApiPlatform/Filter/LikeFilter.php @@ -38,7 +38,7 @@ final class LikeFilter extends AbstractFilter QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, - Operation $operation = null, + ?Operation $operation = null, array $context = [] ): void { // Otherwise filter is applied to order and page as well diff --git a/src/ApiPlatform/Filter/PartStoragelocationFilter.php b/src/ApiPlatform/Filter/PartStoragelocationFilter.php index 860fb320..4d0ad2df 100644 --- a/src/ApiPlatform/Filter/PartStoragelocationFilter.php +++ b/src/ApiPlatform/Filter/PartStoragelocationFilter.php @@ -38,7 +38,7 @@ class PartStoragelocationFilter extends AbstractFilter public function __construct( ManagerRegistry $managerRegistry, private readonly EntityFilterHelper $filter_helper, - LoggerInterface $logger = null, + ?LoggerInterface $logger = null, ?array $properties = null, ?NameConverterInterface $nameConverter = null ) { @@ -51,7 +51,7 @@ class PartStoragelocationFilter extends AbstractFilter QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, - Operation $operation = null, + ?Operation $operation = null, array $context = [] ): void { //Do not check for mapping here, as we are using a virtual property diff --git a/src/Command/User/UserEnableCommand.php b/src/Command/User/UserEnableCommand.php index 00753e94..51ff2280 100644 --- a/src/Command/User/UserEnableCommand.php +++ b/src/Command/User/UserEnableCommand.php @@ -35,7 +35,7 @@ use Symfony\Component\Console\Style\SymfonyStyle; #[AsCommand('partdb:users:enable|partdb:user:enable', 'Enables/Disable the login of one or more users')] class UserEnableCommand extends Command { - public function __construct(protected EntityManagerInterface $entityManager, string $name = null) + public function __construct(protected EntityManagerInterface $entityManager, ?string $name = null) { parent::__construct($name); } diff --git a/src/DataTables/Adapters/TwoStepORMAdapter.php b/src/DataTables/Adapters/TwoStepORMAdapter.php index 2086c907..51315c32 100644 --- a/src/DataTables/Adapters/TwoStepORMAdapter.php +++ b/src/DataTables/Adapters/TwoStepORMAdapter.php @@ -54,7 +54,7 @@ class TwoStepORMAdapter extends ORMAdapter private \Closure|null $query_modifier = null; - public function __construct(ManagerRegistry $registry = null) + public function __construct(?ManagerRegistry $registry = null) { parent::__construct($registry); $this->detailQueryCallable = static function (QueryBuilder $qb, array $ids): never { diff --git a/src/DataTables/Filters/Constraints/AbstractConstraint.php b/src/DataTables/Filters/Constraints/AbstractConstraint.php index cbb62352..7f16511e 100644 --- a/src/DataTables/Filters/Constraints/AbstractConstraint.php +++ b/src/DataTables/Filters/Constraints/AbstractConstraint.php @@ -45,7 +45,7 @@ abstract class AbstractConstraint implements FilterInterface * @var string The property where this BooleanConstraint should apply to */ protected string $property, - string $identifier = null) + ?string $identifier = null) { $this->identifier = $identifier ?? $this->generateParameterIdentifier($property); } diff --git a/src/DataTables/Filters/Constraints/BooleanConstraint.php b/src/DataTables/Filters/Constraints/BooleanConstraint.php index b3f1dc47..8eb4f042 100644 --- a/src/DataTables/Filters/Constraints/BooleanConstraint.php +++ b/src/DataTables/Filters/Constraints/BooleanConstraint.php @@ -28,7 +28,7 @@ class BooleanConstraint extends AbstractConstraint { public function __construct( string $property, - string $identifier = null, + ?string $identifier = null, /** @var bool|null The value of our constraint */ protected ?bool $value = null ) diff --git a/src/DataTables/Filters/Constraints/DateTimeConstraint.php b/src/DataTables/Filters/Constraints/DateTimeConstraint.php index 23134de5..a3043170 100644 --- a/src/DataTables/Filters/Constraints/DateTimeConstraint.php +++ b/src/DataTables/Filters/Constraints/DateTimeConstraint.php @@ -34,7 +34,7 @@ class DateTimeConstraint extends AbstractConstraint public function __construct( string $property, - string $identifier = null, + ?string $identifier = null, /** * The value1 used for comparison (this is the main one used for all mono-value comparisons) */ diff --git a/src/DataTables/Filters/Constraints/EntityConstraint.php b/src/DataTables/Filters/Constraints/EntityConstraint.php index 6e9721f4..c75da80d 100644 --- a/src/DataTables/Filters/Constraints/EntityConstraint.php +++ b/src/DataTables/Filters/Constraints/EntityConstraint.php @@ -46,7 +46,7 @@ class EntityConstraint extends AbstractConstraint public function __construct(protected ?NodesListBuilder $nodesListBuilder, protected string $class, string $property, - string $identifier = null, + ?string $identifier = null, protected ?AbstractDBElement $value = null, protected ?string $operator = null) { diff --git a/src/DataTables/Filters/Constraints/NumberConstraint.php b/src/DataTables/Filters/Constraints/NumberConstraint.php index c872dade..dc7cf733 100644 --- a/src/DataTables/Filters/Constraints/NumberConstraint.php +++ b/src/DataTables/Filters/Constraints/NumberConstraint.php @@ -31,7 +31,7 @@ class NumberConstraint extends AbstractConstraint public function __construct( string $property, - string $identifier = null, + ?string $identifier = null, /** * The value1 used for comparison (this is the main one used for all mono-value comparisons) */ diff --git a/src/DataTables/Filters/Constraints/Part/LessThanDesiredConstraint.php b/src/DataTables/Filters/Constraints/Part/LessThanDesiredConstraint.php index eb96ad33..011824e5 100644 --- a/src/DataTables/Filters/Constraints/Part/LessThanDesiredConstraint.php +++ b/src/DataTables/Filters/Constraints/Part/LessThanDesiredConstraint.php @@ -28,7 +28,7 @@ use Doctrine\ORM\QueryBuilder; class LessThanDesiredConstraint extends BooleanConstraint { - public function __construct(string $property = null, string $identifier = null, ?bool $default_value = null) + public function __construct(?string $property = null, ?string $identifier = null, ?bool $default_value = null) { parent::__construct($property ?? '( SELECT COALESCE(SUM(ld_partLot.amount), 0.0) diff --git a/src/DataTables/Filters/Constraints/Part/TagsConstraint.php b/src/DataTables/Filters/Constraints/Part/TagsConstraint.php index cb17de5c..02eab7a1 100644 --- a/src/DataTables/Filters/Constraints/Part/TagsConstraint.php +++ b/src/DataTables/Filters/Constraints/Part/TagsConstraint.php @@ -30,7 +30,7 @@ class TagsConstraint extends AbstractConstraint { final public const ALLOWED_OPERATOR_VALUES = ['ANY', 'ALL', 'NONE']; - public function __construct(string $property, string $identifier = null, + public function __construct(string $property, ?string $identifier = null, protected ?string $value = null, protected ?string $operator = '') { diff --git a/src/DataTables/Filters/Constraints/TextConstraint.php b/src/DataTables/Filters/Constraints/TextConstraint.php index 671f90ef..31b12a5e 100644 --- a/src/DataTables/Filters/Constraints/TextConstraint.php +++ b/src/DataTables/Filters/Constraints/TextConstraint.php @@ -32,7 +32,7 @@ class TextConstraint extends AbstractConstraint /** * @param string $value */ - public function __construct(string $property, string $identifier = null, /** + public function __construct(string $property, ?string $identifier = null, /** * @var string|null The value to compare to */ protected ?string $value = null, /** diff --git a/src/Entity/Base/AbstractCompany.php b/src/Entity/Base/AbstractCompany.php index ccb74633..947d1339 100644 --- a/src/Entity/Base/AbstractCompany.php +++ b/src/Entity/Base/AbstractCompany.php @@ -162,7 +162,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement * * @return string the link to the article */ - public function getAutoProductUrl(string $partnr = null): string + public function getAutoProductUrl(?string $partnr = null): string { if (is_string($partnr)) { return str_replace('%PARTNUMBER%', $partnr, $this->auto_product_url); diff --git a/src/Entity/OAuthToken.php b/src/Entity/OAuthToken.php index 0073aeed..bc692369 100644 --- a/src/Entity/OAuthToken.php +++ b/src/Entity/OAuthToken.php @@ -54,7 +54,7 @@ class OAuthToken extends AbstractNamedDBElement implements AccessTokenInterface */ private const DEFAULT_EXPIRATION_TIME = 3600; - public function __construct(string $name, ?string $refresh_token, ?string $token = null, \DateTimeImmutable $expires_at = null) + public function __construct(string $name, ?string $refresh_token, ?string $token = null, ?\DateTimeImmutable $expires_at = null) { //If token is given, you also have to give the expires_at date if ($token !== null && $expires_at === null) { diff --git a/src/Migration/WithPermPresetsTrait.php b/src/Migration/WithPermPresetsTrait.php index 5182f3b6..44bc4510 100644 --- a/src/Migration/WithPermPresetsTrait.php +++ b/src/Migration/WithPermPresetsTrait.php @@ -62,7 +62,7 @@ trait WithPermPresetsTrait return json_encode($user->getPermissions()); } - public function setContainer(ContainerInterface $container = null): void + public function setContainer(?ContainerInterface $container = null): void { if ($container !== null) { $this->container = $container; diff --git a/src/Repository/LogEntryRepository.php b/src/Repository/LogEntryRepository.php index bf9909c5..6850d06b 100644 --- a/src/Repository/LogEntryRepository.php +++ b/src/Repository/LogEntryRepository.php @@ -160,7 +160,7 @@ class LogEntryRepository extends DBElementRepository * @param int|null $limit * @param int|null $offset */ - public function getLogsOrderedByTimestamp(string $order = 'DESC', int $limit = null, int $offset = null): array + public function getLogsOrderedByTimestamp(string $order = 'DESC', ?int $limit = null, ?int $offset = null): array { return $this->findBy([], ['timestamp' => $order], $limit, $offset); } diff --git a/src/Security/ApiTokenAuthenticator.php b/src/Security/ApiTokenAuthenticator.php index 23ab68b9..a52b1f7c 100644 --- a/src/Security/ApiTokenAuthenticator.php +++ b/src/Security/ApiTokenAuthenticator.php @@ -131,7 +131,7 @@ class ApiTokenAuthenticator implements AuthenticatorInterface /** * @see https://datatracker.ietf.org/doc/html/rfc6750#section-3 */ - private function getAuthenticateHeader(string $errorDescription = null): string + private function getAuthenticateHeader(?string $errorDescription = null): string { $data = [ 'realm' => $this->realm, diff --git a/src/Security/AuthenticationEntryPoint.php b/src/Security/AuthenticationEntryPoint.php index c26e7667..41f624b2 100644 --- a/src/Security/AuthenticationEntryPoint.php +++ b/src/Security/AuthenticationEntryPoint.php @@ -47,7 +47,7 @@ class AuthenticationEntryPoint implements AuthenticationEntryPointInterface ) { } - public function start(Request $request, AuthenticationException $authException = null): Response + public function start(Request $request, ?AuthenticationException $authException = null): Response { //Check if the request is an API request if ($this->isJSONRequest($request)) { diff --git a/src/Security/SamlUserFactory.php b/src/Security/SamlUserFactory.php index d5c68146..312be859 100644 --- a/src/Security/SamlUserFactory.php +++ b/src/Security/SamlUserFactory.php @@ -116,10 +116,10 @@ class SamlUserFactory implements SamlUserFactoryInterface, EventSubscriberInterf * Maps a list of SAML roles to a local group ID. * The first available mapping will be used (so the order of the $map is important, first match wins). * @param array $roles The list of SAML roles - * @param array $map|null The mapping from SAML roles. If null, the global mapping will be used. + * @param array|null $map The mapping from SAML roles. If null, the global mapping will be used. * @return int|null The ID of the local group or null if no mapping was found. */ - public function mapSAMLRolesToLocalGroupID(array $roles, array $map = null): ?int + public function mapSAMLRolesToLocalGroupID(array $roles, ?array $map = null): ?int { $map ??= $this->saml_role_mapping; diff --git a/src/Serializer/AttachmentNormalizer.php b/src/Serializer/AttachmentNormalizer.php index bb167fc6..8a37b3c0 100644 --- a/src/Serializer/AttachmentNormalizer.php +++ b/src/Serializer/AttachmentNormalizer.php @@ -42,7 +42,7 @@ class AttachmentNormalizer implements NormalizerInterface, NormalizerAwareInterf { } - public function normalize(mixed $object, string $format = null, array $context = []): array|null + public function normalize(mixed $object, ?string $format = null, array $context = []): array|null { if (!$object instanceof Attachment) { throw new \InvalidArgumentException('This normalizer only supports Attachment objects!'); @@ -60,7 +60,7 @@ class AttachmentNormalizer implements NormalizerInterface, NormalizerAwareInterf return $data; } - public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { // avoid recursion: only call once per object if (isset($context[self::ALREADY_CALLED])) { diff --git a/src/Serializer/BigNumberNormalizer.php b/src/Serializer/BigNumberNormalizer.php index 8ef06d67..10cedfa5 100644 --- a/src/Serializer/BigNumberNormalizer.php +++ b/src/Serializer/BigNumberNormalizer.php @@ -33,12 +33,12 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; class BigNumberNormalizer implements NormalizerInterface, DenormalizerInterface { - public function supportsNormalization($data, string $format = null, array $context = []): bool + public function supportsNormalization($data, ?string $format = null, array $context = []): bool { return $data instanceof BigNumber; } - public function normalize($object, string $format = null, array $context = []): string + public function normalize($object, ?string $format = null, array $context = []): string { if (!$object instanceof BigNumber) { throw new \InvalidArgumentException('This normalizer only supports BigNumber objects!'); @@ -58,7 +58,7 @@ class BigNumberNormalizer implements NormalizerInterface, DenormalizerInterface ]; } - public function denormalize(mixed $data, string $type, string $format = null, array $context = []): BigNumber|null + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): BigNumber|null { if (!is_a($type, BigNumber::class, true)) { throw new \InvalidArgumentException('This normalizer only supports BigNumber objects!'); @@ -67,7 +67,7 @@ class BigNumberNormalizer implements NormalizerInterface, DenormalizerInterface return $type::of($data); } - 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 { //data must be a string or a number (int, float, etc.) and the type must be BigNumber or BigDecimal return (is_string($data) || is_numeric($data)) && (is_subclass_of($type, BigNumber::class)); diff --git a/src/Serializer/PartNormalizer.php b/src/Serializer/PartNormalizer.php index e527548f..9050abfc 100644 --- a/src/Serializer/PartNormalizer.php +++ b/src/Serializer/PartNormalizer.php @@ -63,13 +63,13 @@ class PartNormalizer implements NormalizerInterface, DenormalizerInterface, Norm { } - public function supportsNormalization($data, string $format = null, array $context = []): bool + public function supportsNormalization($data, ?string $format = null, array $context = []): bool { //We only remove the type field for CSV export return !isset($context[self::ALREADY_CALLED]) && $format === 'csv' && $data instanceof Part ; } - public function normalize($object, string $format = null, array $context = []): array + public function normalize($object, ?string $format = null, array $context = []): array { if (!$object instanceof Part) { throw new \InvalidArgumentException('This normalizer only supports Part objects!'); @@ -117,7 +117,7 @@ class PartNormalizer implements NormalizerInterface, DenormalizerInterface, Norm return $data; } - public function denormalize($data, string $type, string $format = null, array $context = []): ?Part + public function denormalize($data, string $type, ?string $format = null, array $context = []): ?Part { $this->normalizeKeys($data); diff --git a/src/Serializer/StructuralElementDenormalizer.php b/src/Serializer/StructuralElementDenormalizer.php index 92af8db3..d9b03ae7 100644 --- a/src/Serializer/StructuralElementDenormalizer.php +++ b/src/Serializer/StructuralElementDenormalizer.php @@ -49,7 +49,7 @@ class StructuralElementDenormalizer implements DenormalizerInterface, Denormaliz { } - public function supportsDenormalization($data, string $type, string $format = null, array $context = []): bool + public function supportsDenormalization($data, string $type, ?string $format = null, array $context = []): bool { //Only denormalize if we are doing a file import operation if (!($context['partdb_import'] ?? false)) { @@ -78,7 +78,7 @@ class StructuralElementDenormalizer implements DenormalizerInterface, Denormaliz * @return AbstractStructuralDBElement|null * @phpstan-return T|null */ - public function denormalize($data, string $type, string $format = null, array $context = []): ?AbstractStructuralDBElement + public function denormalize($data, string $type, ?string $format = null, array $context = []): ?AbstractStructuralDBElement { //Do not use API Platform's denormalizer $context[SkippableItemNormalizer::DISABLE_ITEM_NORMALIZER] = true; diff --git a/src/Serializer/StructuralElementFromNameDenormalizer.php b/src/Serializer/StructuralElementFromNameDenormalizer.php index 92da353f..1d7255b7 100644 --- a/src/Serializer/StructuralElementFromNameDenormalizer.php +++ b/src/Serializer/StructuralElementFromNameDenormalizer.php @@ -36,7 +36,7 @@ class StructuralElementFromNameDenormalizer implements DenormalizerInterface { } - public function supportsDenormalization($data, string $type, string $format = null, array $context = []): bool + public function supportsDenormalization($data, string $type, ?string $format = null, array $context = []): bool { //Only denormalize if we are doing a file import operation if (!($context['partdb_import'] ?? false)) { @@ -51,7 +51,7 @@ class StructuralElementFromNameDenormalizer implements DenormalizerInterface * @phpstan-param class-string $type * @phpstan-return T|null */ - public function denormalize($data, string $type, string $format = null, array $context = []): AbstractStructuralDBElement|null + public function denormalize($data, string $type, ?string $format = null, array $context = []): AbstractStructuralDBElement|null { //Retrieve the repository for the given type /** @var StructuralDBElementRepository $repo */ diff --git a/src/Serializer/StructuralElementNormalizer.php b/src/Serializer/StructuralElementNormalizer.php index 1838f210..e73f69be 100644 --- a/src/Serializer/StructuralElementNormalizer.php +++ b/src/Serializer/StructuralElementNormalizer.php @@ -38,7 +38,7 @@ class StructuralElementNormalizer implements NormalizerInterface { } - public function supportsNormalization($data, string $format = null, array $context = []): bool + public function supportsNormalization($data, ?string $format = null, array $context = []): bool { //Only normalize if we are doing a file export operation if (!($context['partdb_export'] ?? false)) { @@ -48,7 +48,7 @@ class StructuralElementNormalizer implements NormalizerInterface return $data instanceof AbstractStructuralDBElement; } - public function normalize($object, string $format = null, array $context = []): mixed + public function normalize($object, ?string $format = null, array $context = []): mixed { if (!$object instanceof AbstractStructuralDBElement) { throw new \InvalidArgumentException('This normalizer only supports AbstractStructural objects!'); diff --git a/src/Services/ImportExportSystem/EntityImporter.php b/src/Services/ImportExportSystem/EntityImporter.php index fb12c3bc..cecab12d 100644 --- a/src/Services/ImportExportSystem/EntityImporter.php +++ b/src/Services/ImportExportSystem/EntityImporter.php @@ -357,7 +357,7 @@ class EntityImporter * @param iterable $entities the list of entities that should be fixed * @param AbstractStructuralDBElement|null $parent the parent, to which the entity should be set */ - protected function correctParentEntites(iterable $entities, AbstractStructuralDBElement $parent = null): void + protected function correctParentEntites(iterable $entities, ?AbstractStructuralDBElement $parent = null): void { foreach ($entities as $entity) { /** @var AbstractStructuralDBElement $entity */ diff --git a/src/Services/InfoProviderSystem/Providers/OEMSecretsProvider.php b/src/Services/InfoProviderSystem/Providers/OEMSecretsProvider.php index 57c5b815..ccf800f8 100644 --- a/src/Services/InfoProviderSystem/Providers/OEMSecretsProvider.php +++ b/src/Services/InfoProviderSystem/Providers/OEMSecretsProvider.php @@ -1221,7 +1221,7 @@ class OEMSecretsProvider implements InfoProviderInterface * - 'value_min' => string|null The minimum value in a range, if applicable. * - 'value_max' => string|null The maximum value in a range, if applicable. */ - private function customSplitIntoValueAndUnit(string $value1, string $value2 = null): array + private function customSplitIntoValueAndUnit(string $value1, ?string $value2 = null): array { // Separate numbers and units (basic parsing handling) $unit = null; diff --git a/src/Validator/Constraints/UniqueObjectCollection.php b/src/Validator/Constraints/UniqueObjectCollection.php index c71fcc5d..6548494e 100644 --- a/src/Validator/Constraints/UniqueObjectCollection.php +++ b/src/Validator/Constraints/UniqueObjectCollection.php @@ -43,12 +43,12 @@ class UniqueObjectCollection extends Constraint * @param array|string $fields the combination of fields that must contain unique values or a set of options */ public function __construct( - array $options = null, - string $message = null, - callable $normalizer = null, - array $groups = null, + ?array $options = null, + ?string $message = null, + ?callable $normalizer = null, + ?array $groups = null, mixed $payload = null, - array|string $fields = null, + array|string|null $fields = null, public bool $allowNull = true, ) { parent::__construct($options, $groups, $payload); diff --git a/src/Validator/Constraints/ValidGoogleAuthCode.php b/src/Validator/Constraints/ValidGoogleAuthCode.php index 482af35c..180d346e 100644 --- a/src/Validator/Constraints/ValidGoogleAuthCode.php +++ b/src/Validator/Constraints/ValidGoogleAuthCode.php @@ -31,8 +31,8 @@ class ValidGoogleAuthCode extends Constraint * @param TwoFactorInterface|null $user The user to use for the validation process, if null, the current user is used */ public function __construct( - array $options = null, - array $groups = null, + ?array $options = null, + ?array $groups = null, mixed $payload = null, public ?TwoFactorInterface $user = null) {