wip: form refactoring

This commit is contained in:
Björn Fromme
2025-07-25 09:28:13 +02:00
parent 2b122a7cc4
commit ae2ed306b9
13 changed files with 158 additions and 100 deletions
+7 -3
View File
@@ -5,10 +5,10 @@ declare(strict_types=1);
namespace App\Form\Service;
use App\Form\Model\BookingDtoInterface;
use App\Form\ParticipantFieldHandler\Condition\FieldConditionInterface;
use App\Form\ParticipantFieldHandler\Condition\MutabilityCondition;
use App\Form\ParticipantFieldHandler\Condition\ApplicantCondition;
use App\Form\ParticipantFieldHandler\Condition\CompositeCondition;
use App\Form\ParticipantFieldHandler\Condition\FieldConditionInterface;
use App\Form\ParticipantFieldHandler\Condition\MutabilityCondition;
/**
* Field state provider for the booking edit workflow.
@@ -21,6 +21,8 @@ use App\Form\ParticipantFieldHandler\Condition\CompositeCondition;
*/
class EditFieldStateProvider implements FieldStateProviderInterface
{
use FormTraversalTrait;
/** @var array<string, array<string, FieldConditionInterface>> */
private array $fieldStateConditions = [];
@@ -109,6 +111,7 @@ class EditFieldStateProvider implements FieldStateProviderInterface
foreach ($this->fieldStateConditions[$fieldName] as $condition) {
$dependencies = array_merge($dependencies, $condition->getDependentFields());
}
return array_unique($dependencies);
}
@@ -121,6 +124,7 @@ class EditFieldStateProvider implements FieldStateProviderInterface
$allStates[$fieldName] = $fieldState;
}
}
return $allStates;
}
}
}