merge upgrade-sf5 into branch for latest fixes

This commit is contained in:
2024-06-25 15:54:22 +02:00
97 changed files with 3720 additions and 714 deletions

View File

@@ -592,14 +592,15 @@ class Household implements HasCentersInterface
}
#[Assert\Callback]
public function validate(ExecutionContextInterface $context, $payload)
public function validate(ExecutionContextInterface $context, $payload): void
{
$addresses = $this->getAddresses();
$cond = true;
$addresses = $this->getAddressesOrdered();
for ($i = 0; \count($addresses) - 1 > $i; ++$i) {
if ($addresses[$i]->getValidFrom() !== $addresses[$i + 1]->getValidTo()) {
$cond = false;
if (0 === $i) {
continue;
}
if ($addresses[$i - 1]->getValidTo() !== $addresses[$i]->getValidFrom()) {
$context->buildViolation('The address are not sequentials. The validFrom date of one address should be equal to the validTo date of the previous address.')
->atPath('addresses')
->addViolation();