diff --git a/.changes/unreleased/DX-20250407-121010.yaml b/.changes/unreleased/DX-20250407-121010.yaml index 2347b046d..1f8a0496a 100644 --- a/.changes/unreleased/DX-20250407-121010.yaml +++ b/.changes/unreleased/DX-20250407-121010.yaml @@ -34,11 +34,38 @@ changelog: | + 'Chill\MainBundle\Export\Messenger\ExportRequestGenerationMessage': priority ``` + - add missing methods to exports, aggregators, filters, formatter: + + ```php + public function normalizeFormData(array $formData): array; + + public function denormalizeFormData(array $formData, int $fromVersion): array; + ``` + + There are rector rules to generate those methods: + + - `Chill\Utils\Rector\Rector\ChillBundleAddNormalizationMethodsOnExportRector` + + See: + + ```php + // upgrade chill exports + $rectorConfig->rules([\Chill\Utils\Rector\Rector\ChillBundleAddNormalizationMethodsOnExportRector::class]); + ``` + + This rule will create most of the work necessary, but some manuals changes are still necessary: + + - we must set manually the correct repository for method `denormalizeDoctrineEntity`; + - when the form data contains some entities, and the form type is not one of EntityType::class, PickUserDynamicType::class, PickUserLocationType::class, PickThirdpartyDynamicType::class, Select2CountryType::class, then we must handle the normalization manually (using the `\Chill\MainBundle\Export\ExportDataNormalizerTrait`) -time: 2025-04-07T12:10:10.682561327+02:00 + + + + + time: 2025-04-07T12:10:10.682561327+02:00 custom: Issue: "" SchemaChange: Add columns or tables diff --git a/rector.php b/rector.php index bf74f29cd..2b8180208 100644 --- a/rector.php +++ b/rector.php @@ -37,9 +37,6 @@ return static function (RectorConfig $rectorConfig): void { $rectorConfig->rule(Rector\TypeDeclaration\Rector\Class_\MergeDateTimePropertyTypeDeclarationRector::class); $rectorConfig->rule(Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationBasedOnParentClassMethodRector::class); - // upgrade chill exports - $rectorConfig->rules([\Chill\Utils\Rector\Rector\ChillBundleAddNormalizationMethodsOnExportRector::class]); - // part of the symfony 54 rules $rectorConfig->rule(\Rector\Symfony\Symfony53\Rector\StaticPropertyFetch\KernelTestCaseContainerPropertyDeprecationRector::class); $rectorConfig->rule(\Rector\Symfony\Symfony60\Rector\MethodCall\GetHelperControllerToServiceRector::class);