-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make form listener work without decorating shopware form listener
- Loading branch information
Showing
3 changed files
with
4 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,6 @@ | |
|
||
namespace ShyimProfiler\Components; | ||
|
||
|
||
use Shopware\Bundle\FormBundle\Extension\EventExtension; | ||
use Symfony\Component\Form\AbstractTypeExtension; | ||
use Symfony\Component\Form\Extension\DataCollector\FormDataCollectorInterface; | ||
use Symfony\Component\Form\FormBuilderInterface; | ||
|
@@ -13,12 +11,6 @@ | |
|
||
class FormListener extends AbstractTypeExtension | ||
{ | ||
/** | ||
* @var EventExtension | ||
* @author Soner Sayakci <[email protected]> | ||
*/ | ||
private $eventExtension; | ||
|
||
/** | ||
* @var FormDataCollectorInterface | ||
* @author Soner Sayakci <[email protected]> | ||
|
@@ -27,13 +19,11 @@ class FormListener extends AbstractTypeExtension | |
|
||
/** | ||
* FormListener constructor. | ||
* @param EventExtension $eventExtension | ||
* @param FormDataCollectorInterface $formDataCollector | ||
* @author Soner Sayakci <[email protected]> | ||
*/ | ||
public function __construct(EventExtension $eventExtension, FormDataCollectorInterface $formDataCollector) | ||
public function __construct(FormDataCollectorInterface $formDataCollector) | ||
{ | ||
$this->eventExtension = $eventExtension; | ||
$this->dataCollector = $formDataCollector; | ||
} | ||
|
||
|
@@ -47,7 +37,6 @@ public function buildForm(FormBuilderInterface $builder, array $options) | |
{ | ||
$builder->addEventListener(FormEvents::POST_SET_DATA, [$this, 'postSetData'], 255); | ||
$builder->addEventListener(FormEvents::POST_SUBMIT, [$this, 'postSubmit'], -255); | ||
$this->eventExtension->buildForm($builder, $options); | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters