Skip to content

Commit

Permalink
Moved deprecation to default options callback
Browse files Browse the repository at this point in the history
  • Loading branch information
ViniTou committed Jul 10, 2024
1 parent 103b2c0 commit 9fc84c5
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/lib/Form/Type/Content/BaseContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ public function configureOptions(OptionsResolver $resolver)
return $value;
}

trigger_deprecation(
'ibexa/content-forms',
'v4.6',
'The option "struct" with null value is deprecated and will be required in v5.0.'
);

return $options['contentUpdateStruct']
?? $options['contentCreateStruct']
?? null;
Expand Down Expand Up @@ -101,20 +107,6 @@ public function configureOptions(OptionsResolver $resolver)
'ibexa/content-forms',
'v4.6.4',
'The option "%name%" is deprecated, use "struct" instead.'
)
->setNormalizer(
'struct',
static function (Options $options, ?ContentStruct $value): ?ContentStruct {
if ($value === null) {
trigger_deprecation(
'ibexa/content-forms',
'v4.6',
'The option "struct" with null value is deprecated and will be required in v5.0.'
);
}

return $value;
}
);
}
}
Expand Down

0 comments on commit 9fc84c5

Please sign in to comment.