mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Fixed "implicitly marking parameter as nullable" deprecations in PHP 8.4 fixed
This commit is contained in:
parent
d94c4af1be
commit
b724b05de6
31 changed files with 50 additions and 50 deletions
|
@ -43,9 +43,9 @@ class AddDocumentedAPIPropertiesJSONSchemaFactory implements SchemaFactoryInterf
|
||||||
string $className,
|
string $className,
|
||||||
string $format = 'json',
|
string $format = 'json',
|
||||||
string $type = Schema::TYPE_OUTPUT,
|
string $type = Schema::TYPE_OUTPUT,
|
||||||
Operation $operation = null,
|
?Operation $operation = null,
|
||||||
Schema $schema = null,
|
?Schema $schema = null,
|
||||||
array $serializerContext = null,
|
?array $serializerContext = null,
|
||||||
bool $forceCollection = false
|
bool $forceCollection = false
|
||||||
): Schema {
|
): Schema {
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ class EntityFilter extends AbstractFilter
|
||||||
public function __construct(
|
public function __construct(
|
||||||
ManagerRegistry $managerRegistry,
|
ManagerRegistry $managerRegistry,
|
||||||
private readonly EntityFilterHelper $filter_helper,
|
private readonly EntityFilterHelper $filter_helper,
|
||||||
LoggerInterface $logger = null,
|
?LoggerInterface $logger = null,
|
||||||
?array $properties = null,
|
?array $properties = null,
|
||||||
?NameConverterInterface $nameConverter = null
|
?NameConverterInterface $nameConverter = null
|
||||||
) {
|
) {
|
||||||
|
@ -50,7 +50,7 @@ class EntityFilter extends AbstractFilter
|
||||||
QueryBuilder $queryBuilder,
|
QueryBuilder $queryBuilder,
|
||||||
QueryNameGeneratorInterface $queryNameGenerator,
|
QueryNameGeneratorInterface $queryNameGenerator,
|
||||||
string $resourceClass,
|
string $resourceClass,
|
||||||
Operation $operation = null,
|
?Operation $operation = null,
|
||||||
array $context = []
|
array $context = []
|
||||||
): void {
|
): void {
|
||||||
if (
|
if (
|
||||||
|
|
|
@ -38,7 +38,7 @@ final class LikeFilter extends AbstractFilter
|
||||||
QueryBuilder $queryBuilder,
|
QueryBuilder $queryBuilder,
|
||||||
QueryNameGeneratorInterface $queryNameGenerator,
|
QueryNameGeneratorInterface $queryNameGenerator,
|
||||||
string $resourceClass,
|
string $resourceClass,
|
||||||
Operation $operation = null,
|
?Operation $operation = null,
|
||||||
array $context = []
|
array $context = []
|
||||||
): void {
|
): void {
|
||||||
// Otherwise filter is applied to order and page as well
|
// Otherwise filter is applied to order and page as well
|
||||||
|
|
|
@ -38,7 +38,7 @@ class PartStoragelocationFilter extends AbstractFilter
|
||||||
public function __construct(
|
public function __construct(
|
||||||
ManagerRegistry $managerRegistry,
|
ManagerRegistry $managerRegistry,
|
||||||
private readonly EntityFilterHelper $filter_helper,
|
private readonly EntityFilterHelper $filter_helper,
|
||||||
LoggerInterface $logger = null,
|
?LoggerInterface $logger = null,
|
||||||
?array $properties = null,
|
?array $properties = null,
|
||||||
?NameConverterInterface $nameConverter = null
|
?NameConverterInterface $nameConverter = null
|
||||||
) {
|
) {
|
||||||
|
@ -51,7 +51,7 @@ class PartStoragelocationFilter extends AbstractFilter
|
||||||
QueryBuilder $queryBuilder,
|
QueryBuilder $queryBuilder,
|
||||||
QueryNameGeneratorInterface $queryNameGenerator,
|
QueryNameGeneratorInterface $queryNameGenerator,
|
||||||
string $resourceClass,
|
string $resourceClass,
|
||||||
Operation $operation = null,
|
?Operation $operation = null,
|
||||||
array $context = []
|
array $context = []
|
||||||
): void {
|
): void {
|
||||||
//Do not check for mapping here, as we are using a virtual property
|
//Do not check for mapping here, as we are using a virtual property
|
||||||
|
|
|
@ -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')]
|
#[AsCommand('partdb:users:enable|partdb:user:enable', 'Enables/Disable the login of one or more users')]
|
||||||
class UserEnableCommand extends Command
|
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);
|
parent::__construct($name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ class TwoStepORMAdapter extends ORMAdapter
|
||||||
|
|
||||||
private \Closure|null $query_modifier = null;
|
private \Closure|null $query_modifier = null;
|
||||||
|
|
||||||
public function __construct(ManagerRegistry $registry = null)
|
public function __construct(?ManagerRegistry $registry = null)
|
||||||
{
|
{
|
||||||
parent::__construct($registry);
|
parent::__construct($registry);
|
||||||
$this->detailQueryCallable = static function (QueryBuilder $qb, array $ids): never {
|
$this->detailQueryCallable = static function (QueryBuilder $qb, array $ids): never {
|
||||||
|
|
|
@ -45,7 +45,7 @@ abstract class AbstractConstraint implements FilterInterface
|
||||||
* @var string The property where this BooleanConstraint should apply to
|
* @var string The property where this BooleanConstraint should apply to
|
||||||
*/
|
*/
|
||||||
protected string $property,
|
protected string $property,
|
||||||
string $identifier = null)
|
?string $identifier = null)
|
||||||
{
|
{
|
||||||
$this->identifier = $identifier ?? $this->generateParameterIdentifier($property);
|
$this->identifier = $identifier ?? $this->generateParameterIdentifier($property);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ class BooleanConstraint extends AbstractConstraint
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
string $property,
|
string $property,
|
||||||
string $identifier = null,
|
?string $identifier = null,
|
||||||
/** @var bool|null The value of our constraint */
|
/** @var bool|null The value of our constraint */
|
||||||
protected ?bool $value = null
|
protected ?bool $value = null
|
||||||
)
|
)
|
||||||
|
|
|
@ -34,7 +34,7 @@ class DateTimeConstraint extends AbstractConstraint
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
string $property,
|
string $property,
|
||||||
string $identifier = null,
|
?string $identifier = null,
|
||||||
/**
|
/**
|
||||||
* The value1 used for comparison (this is the main one used for all mono-value comparisons)
|
* The value1 used for comparison (this is the main one used for all mono-value comparisons)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -46,7 +46,7 @@ class EntityConstraint extends AbstractConstraint
|
||||||
public function __construct(protected ?NodesListBuilder $nodesListBuilder,
|
public function __construct(protected ?NodesListBuilder $nodesListBuilder,
|
||||||
protected string $class,
|
protected string $class,
|
||||||
string $property,
|
string $property,
|
||||||
string $identifier = null,
|
?string $identifier = null,
|
||||||
protected ?AbstractDBElement $value = null,
|
protected ?AbstractDBElement $value = null,
|
||||||
protected ?string $operator = null)
|
protected ?string $operator = null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,7 +31,7 @@ class NumberConstraint extends AbstractConstraint
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
string $property,
|
string $property,
|
||||||
string $identifier = null,
|
?string $identifier = null,
|
||||||
/**
|
/**
|
||||||
* The value1 used for comparison (this is the main one used for all mono-value comparisons)
|
* The value1 used for comparison (this is the main one used for all mono-value comparisons)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -28,7 +28,7 @@ use Doctrine\ORM\QueryBuilder;
|
||||||
|
|
||||||
class LessThanDesiredConstraint extends BooleanConstraint
|
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 ?? '(
|
parent::__construct($property ?? '(
|
||||||
SELECT COALESCE(SUM(ld_partLot.amount), 0.0)
|
SELECT COALESCE(SUM(ld_partLot.amount), 0.0)
|
||||||
|
|
|
@ -30,7 +30,7 @@ class TagsConstraint extends AbstractConstraint
|
||||||
{
|
{
|
||||||
final public const ALLOWED_OPERATOR_VALUES = ['ANY', 'ALL', 'NONE'];
|
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 $value = null,
|
||||||
protected ?string $operator = '')
|
protected ?string $operator = '')
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,7 +32,7 @@ class TextConstraint extends AbstractConstraint
|
||||||
/**
|
/**
|
||||||
* @param string $value
|
* @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
|
* @var string|null The value to compare to
|
||||||
*/
|
*/
|
||||||
protected ?string $value = null, /**
|
protected ?string $value = null, /**
|
||||||
|
|
|
@ -162,7 +162,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
|
||||||
*
|
*
|
||||||
* @return string the link to the article
|
* @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)) {
|
if (is_string($partnr)) {
|
||||||
return str_replace('%PARTNUMBER%', $partnr, $this->auto_product_url);
|
return str_replace('%PARTNUMBER%', $partnr, $this->auto_product_url);
|
||||||
|
|
|
@ -54,7 +54,7 @@ class OAuthToken extends AbstractNamedDBElement implements AccessTokenInterface
|
||||||
*/
|
*/
|
||||||
private const DEFAULT_EXPIRATION_TIME = 3600;
|
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 is given, you also have to give the expires_at date
|
||||||
if ($token !== null && $expires_at === null) {
|
if ($token !== null && $expires_at === null) {
|
||||||
|
|
|
@ -62,7 +62,7 @@ trait WithPermPresetsTrait
|
||||||
return json_encode($user->getPermissions());
|
return json_encode($user->getPermissions());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setContainer(ContainerInterface $container = null): void
|
public function setContainer(?ContainerInterface $container = null): void
|
||||||
{
|
{
|
||||||
if ($container !== null) {
|
if ($container !== null) {
|
||||||
$this->container = $container;
|
$this->container = $container;
|
||||||
|
|
|
@ -160,7 +160,7 @@ class LogEntryRepository extends DBElementRepository
|
||||||
* @param int|null $limit
|
* @param int|null $limit
|
||||||
* @param int|null $offset
|
* @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);
|
return $this->findBy([], ['timestamp' => $order], $limit, $offset);
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,7 @@ class ApiTokenAuthenticator implements AuthenticatorInterface
|
||||||
/**
|
/**
|
||||||
* @see https://datatracker.ietf.org/doc/html/rfc6750#section-3
|
* @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 = [
|
$data = [
|
||||||
'realm' => $this->realm,
|
'realm' => $this->realm,
|
||||||
|
|
|
@ -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
|
//Check if the request is an API request
|
||||||
if ($this->isJSONRequest($request)) {
|
if ($this->isJSONRequest($request)) {
|
||||||
|
|
|
@ -116,10 +116,10 @@ class SamlUserFactory implements SamlUserFactoryInterface, EventSubscriberInterf
|
||||||
* Maps a list of SAML roles to a local group ID.
|
* 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).
|
* 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 $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.
|
* @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;
|
$map ??= $this->saml_role_mapping;
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
if (!$object instanceof Attachment) {
|
||||||
throw new \InvalidArgumentException('This normalizer only supports Attachment objects!');
|
throw new \InvalidArgumentException('This normalizer only supports Attachment objects!');
|
||||||
|
@ -60,7 +60,7 @@ class AttachmentNormalizer implements NormalizerInterface, NormalizerAwareInterf
|
||||||
return $data;
|
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
|
// avoid recursion: only call once per object
|
||||||
if (isset($context[self::ALREADY_CALLED])) {
|
if (isset($context[self::ALREADY_CALLED])) {
|
||||||
|
|
|
@ -33,12 +33,12 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||||
class BigNumberNormalizer implements NormalizerInterface, DenormalizerInterface
|
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;
|
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) {
|
if (!$object instanceof BigNumber) {
|
||||||
throw new \InvalidArgumentException('This normalizer only supports BigNumber objects!');
|
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)) {
|
if (!is_a($type, BigNumber::class, true)) {
|
||||||
throw new \InvalidArgumentException('This normalizer only supports BigNumber objects!');
|
throw new \InvalidArgumentException('This normalizer only supports BigNumber objects!');
|
||||||
|
@ -67,7 +67,7 @@ class BigNumberNormalizer implements NormalizerInterface, DenormalizerInterface
|
||||||
return $type::of($data);
|
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
|
//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));
|
return (is_string($data) || is_numeric($data)) && (is_subclass_of($type, BigNumber::class));
|
||||||
|
|
|
@ -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
|
//We only remove the type field for CSV export
|
||||||
return !isset($context[self::ALREADY_CALLED]) && $format === 'csv' && $data instanceof Part ;
|
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) {
|
if (!$object instanceof Part) {
|
||||||
throw new \InvalidArgumentException('This normalizer only supports Part objects!');
|
throw new \InvalidArgumentException('This normalizer only supports Part objects!');
|
||||||
|
@ -117,7 +117,7 @@ class PartNormalizer implements NormalizerInterface, DenormalizerInterface, Norm
|
||||||
return $data;
|
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);
|
$this->normalizeKeys($data);
|
||||||
|
|
||||||
|
|
|
@ -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
|
//Only denormalize if we are doing a file import operation
|
||||||
if (!($context['partdb_import'] ?? false)) {
|
if (!($context['partdb_import'] ?? false)) {
|
||||||
|
@ -78,7 +78,7 @@ class StructuralElementDenormalizer implements DenormalizerInterface, Denormaliz
|
||||||
* @return AbstractStructuralDBElement|null
|
* @return AbstractStructuralDBElement|null
|
||||||
* @phpstan-return T|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
|
//Do not use API Platform's denormalizer
|
||||||
$context[SkippableItemNormalizer::DISABLE_ITEM_NORMALIZER] = true;
|
$context[SkippableItemNormalizer::DISABLE_ITEM_NORMALIZER] = true;
|
||||||
|
|
|
@ -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
|
//Only denormalize if we are doing a file import operation
|
||||||
if (!($context['partdb_import'] ?? false)) {
|
if (!($context['partdb_import'] ?? false)) {
|
||||||
|
@ -51,7 +51,7 @@ class StructuralElementFromNameDenormalizer implements DenormalizerInterface
|
||||||
* @phpstan-param class-string<T> $type
|
* @phpstan-param class-string<T> $type
|
||||||
* @phpstan-return T|null
|
* @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
|
//Retrieve the repository for the given type
|
||||||
/** @var StructuralDBElementRepository<T> $repo */
|
/** @var StructuralDBElementRepository<T> $repo */
|
||||||
|
|
|
@ -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
|
//Only normalize if we are doing a file export operation
|
||||||
if (!($context['partdb_export'] ?? false)) {
|
if (!($context['partdb_export'] ?? false)) {
|
||||||
|
@ -48,7 +48,7 @@ class StructuralElementNormalizer implements NormalizerInterface
|
||||||
return $data instanceof AbstractStructuralDBElement;
|
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) {
|
if (!$object instanceof AbstractStructuralDBElement) {
|
||||||
throw new \InvalidArgumentException('This normalizer only supports AbstractStructural objects!');
|
throw new \InvalidArgumentException('This normalizer only supports AbstractStructural objects!');
|
||||||
|
|
|
@ -357,7 +357,7 @@ class EntityImporter
|
||||||
* @param iterable $entities the list of entities that should be fixed
|
* @param iterable $entities the list of entities that should be fixed
|
||||||
* @param AbstractStructuralDBElement|null $parent the parent, to which the entity should be set
|
* @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) {
|
foreach ($entities as $entity) {
|
||||||
/** @var AbstractStructuralDBElement $entity */
|
/** @var AbstractStructuralDBElement $entity */
|
||||||
|
|
|
@ -1221,7 +1221,7 @@ class OEMSecretsProvider implements InfoProviderInterface
|
||||||
* - 'value_min' => string|null The minimum value in a range, if applicable.
|
* - 'value_min' => string|null The minimum value in a range, if applicable.
|
||||||
* - 'value_max' => string|null The maximum 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)
|
// Separate numbers and units (basic parsing handling)
|
||||||
$unit = null;
|
$unit = null;
|
||||||
|
|
|
@ -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
|
* @param array|string $fields the combination of fields that must contain unique values or a set of options
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
array $options = null,
|
?array $options = null,
|
||||||
string $message = null,
|
?string $message = null,
|
||||||
callable $normalizer = null,
|
?callable $normalizer = null,
|
||||||
array $groups = null,
|
?array $groups = null,
|
||||||
mixed $payload = null,
|
mixed $payload = null,
|
||||||
array|string $fields = null,
|
array|string|null $fields = null,
|
||||||
public bool $allowNull = true,
|
public bool $allowNull = true,
|
||||||
) {
|
) {
|
||||||
parent::__construct($options, $groups, $payload);
|
parent::__construct($options, $groups, $payload);
|
||||||
|
|
|
@ -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
|
* @param TwoFactorInterface|null $user The user to use for the validation process, if null, the current user is used
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
array $options = null,
|
?array $options = null,
|
||||||
array $groups = null,
|
?array $groups = null,
|
||||||
mixed $payload = null,
|
mixed $payload = null,
|
||||||
public ?TwoFactorInterface $user = null)
|
public ?TwoFactorInterface $user = null)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue