99namespace Ibexa \ContentForms \Form \Type \Content ;
1010
1111use Ibexa \Contracts \Core \Repository \Values \Content \ContentCreateStruct ;
12+ use Ibexa \Contracts \Core \Repository \Values \Content \ContentStruct ;
1213use Ibexa \Contracts \Core \Repository \Values \Content \ContentUpdateStruct ;
13- use Ibexa \Contracts \Core \Repository \Values \User \UserCreateStruct ;
14- use Ibexa \Contracts \Core \Repository \Values \User \UserUpdateStruct ;
1514use JMS \TranslationBundle \Annotation \Desc ;
1615use Symfony \Component \Form \AbstractType ;
1716use Symfony \Component \Form \Extension \Core \Type \HiddenType ;
@@ -69,14 +68,18 @@ public function configureOptions(OptionsResolver $resolver)
6968 {
7069 $ resolver
7170 ->setRequired (['languageCode ' , 'mainLanguageCode ' , 'struct ' ])
72- ->setDefault ('struct ' , static function (Options $ options , $ value ) {
71+ ->setDefault ('struct ' , static function (Options $ options , ? ContentStruct $ value ) {
7372 if ($ value !== null ) {
7473 return $ value ;
7574 }
7675
77- return $ options ['userUpdateStruct ' ]
78- ?? $ options ['userCreateStruct ' ]
79- ?? $ options ['contentUpdateStruct ' ]
76+ trigger_deprecation (
77+ 'ibexa/content-forms ' ,
78+ 'v4.6 ' ,
79+ 'The option "struct" with null value is deprecated and will be required in v5.0. '
80+ );
81+
82+ return $ options ['contentUpdateStruct ' ]
8083 ?? $ options ['contentCreateStruct ' ]
8184 ?? null ;
8285 })
@@ -91,8 +94,6 @@ public function configureOptions(OptionsResolver $resolver)
9194 'null ' ,
9295 ContentCreateStruct::class,
9396 ContentUpdateStruct::class,
94- UserCreateStruct::class,
95- UserUpdateStruct::class,
9697 ],
9798 )
9899 ->setDeprecated (
0 commit comments