@@ -26,18 +26,12 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
2626
2727class MyChannelType extends AbstractType
2828{
29- /**
30- * {@inheritdoc}
31- */
32- public function buildForm(FormBuilderInterface $builder, array $options)
29+ public function buildForm(FormBuilderInterface $builder, array $options) : void
3330 {
3431 $builder->add('myConfigField', TextType::class);
3532 }
3633
37- /**
38- * {@inheritdoc}
39- */
40- public function configureOptions(OptionsResolver $resolver)
34+ public function configureOptions(OptionsResolver $resolver) : void
4135 {
4236 $resolver->setDefaults([]);
4337 }
@@ -58,48 +52,29 @@ use FormBuilderBundle\Form\FormValuesOutputApplierInterface;
5852
5953class MyChannel implements ChannelInterface
6054{
61- /**
62- * @var FormValuesOutputApplierInterface
63- */
64- protected $formValuesOutputApplier;
65-
66- public function __construct(FormValuesOutputApplierInterface $formValuesOutputApplier)
55+ public function __construct(protected FormValuesOutputApplierInterface $formValuesOutputApplier)
6756 {
68- $this->formValuesOutputApplier = $formValuesOutputApplier;
6957 }
7058
71- /**
72- * {@inheritdoc}
73- */
7459 public function getFormType(): string
7560 {
7661 // you need to create a form type for backend configuration validation.
7762 return MyChannelType::class;
7863 }
7964
80- /**
81- * {@inheritdoc}
82- */
8365 public function isLocalizedConfiguration(): bool
8466 {
8567 return false;
8668 }
8769
88- /**
89- * {@inheritdoc}
90- */
91- public function getUsedFormFieldNames(array $channelConfiguration)
70+ public function getUsedFormFieldNames(array $channelConfiguration): array
9271 {
9372 return [];
9473 }
9574
96- /**
97- * {@inheritdoc}
98- */
99- public function dispatchOutputProcessing(SubmissionEvent $submissionEvent, string $workflowName, array $channelConfiguration)
75+ public function dispatchOutputProcessing(SubmissionEvent $submissionEvent, string $workflowName, array $channelConfiguration): void
10076 {
101- $formConfiguration = $submissionEvent->getFormConfiguration();
102- $locale = $submissionEvent->getRequest()->getLocale();
77+ $locale = $submissionEvent->getLocale() ?? $submissionEvent->getRequest()->getLocale();
10378 $form = $submissionEvent->getForm();
10479
10580 // Output Transformer (See section "Output Transformer" above).
@@ -112,7 +87,8 @@ class MyChannel implements ChannelInterface
11287```
11388
11489## ExtJS Class
115- You need to register this class via ` \Pimcore\Event\BundleManagerEvents::JS_PATHS ` Event.
90+ You need to register this class via ` \Pimcore\Event\BundleManagerEvents::JS_PATHS ` Event.
91+ Make sure, that you've defined a low priority, to allow loading fb resources first!.
11692
11793``` js
11894pimcore .registerNS (' Formbuilder.extjs.formPanel.outputWorkflow.channel.myChannel' );
0 commit comments