Skip to content

Commit

Permalink
Fix BlockService to work with current Form (#721)
Browse files Browse the repository at this point in the history
* fixes #715

* fix phpstan and use array

* remove unused FormBuilderInterface
  • Loading branch information
haivala committed Sep 25, 2022
1 parent 7b74b13 commit 4bbb8ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -57,7 +57,7 @@
"phpunit/phpunit": "^9.5",
"psalm/plugin-phpunit": "^0.17",
"psalm/plugin-symfony": "^3.1",
"rector/rector": "^0.13",
"rector/rector": "^0.14",
"sonata-project/admin-bundle": "^4.0",
"sonata-project/classification-bundle": "^4.0",
"sonata-project/doctrine-extensions": "^1.0 || ^2.0",
Expand Down
8 changes: 3 additions & 5 deletions src/Block/FormatterBlockService.php
Expand Up @@ -23,7 +23,6 @@
use Sonata\Form\Type\ImmutableArrayType;
use Sonata\Form\Validator\ErrorElement;
use Sonata\FormatterBundle\Form\Type\FormatterType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\OptionsResolver\OptionsResolver;

Expand All @@ -47,10 +46,9 @@ public function configureEditForm(FormMapper $form, BlockInterface $block): void
{
$form->add('settings', ImmutableArrayType::class, [
'keys' => [
['content', FormatterType::class, static fn (FormBuilderInterface $formBuilder) => [
'event_dispatcher' => $formBuilder->getEventDispatcher(),
'format_field' => ['format', '[format]'],
'source_field' => ['rawContent', '[rawContent]'],
['content', FormatterType::class, [
'format_field' => 'format',
'source_field' => 'rawContent',
'target_field' => '[content]',
'label' => 'form.label_content',
]],
Expand Down

0 comments on commit 4bbb8ac

Please sign in to comment.