Skip to content

Commit f132622

Browse files
committed
Fix constraint array-options syntax removed in Symfony 8.1
NotNull (and all Symfony constraints) no longer accept an options array in the constructor as of Symfony 8.1. Switch to named arguments.
1 parent 5c8fa0b commit f132622

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

src/Validator/MappingLoader/TimestampedLoader.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,16 @@ public function loadClassMetadata(ClassMetadata $metadata): bool
4343
$metadata->addPropertyConstraint(
4444
$configuration->createdAtField,
4545
new Assert\NotNull(
46-
[
47-
'groups' => [\sprintf('%s:timestamped', $shortName)],
48-
'message' => \sprintf('%s should not be null', $configuration->createdAtField),
49-
]
46+
groups: [\sprintf('%s:timestamped', $shortName)],
47+
message: \sprintf('%s should not be null', $configuration->createdAtField),
5048
)
5149
);
5250

5351
$metadata->addPropertyConstraint(
5452
$configuration->modifiedAtField,
5553
new Assert\NotNull(
56-
[
57-
'groups' => [\sprintf('%s:timestamped', $shortName)],
58-
'message' => \sprintf('%s should not be null', $configuration->modifiedAtField),
59-
]
54+
groups: [\sprintf('%s:timestamped', $shortName)],
55+
message: \sprintf('%s should not be null', $configuration->modifiedAtField),
6056
)
6157
);
6258

0 commit comments

Comments
 (0)