Skip to content

Commit

Permalink
Mautic 4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
kuzmany committed Sep 12, 2021
1 parent b84b413 commit 46e221a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions EventListener/FormSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
use MauticPlugin\MauticFormActionsBundle\Model\FormActionsModel;
use MauticPlugin\MauticFormActionsBundle\Trigger\TriggerFactory;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Twig\Environment;
use Twig\TwigFilter;

class FormSubscriber implements EventSubscriberInterface
{
Expand All @@ -33,7 +35,7 @@ class FormSubscriber implements EventSubscriberInterface
private $formActionsSettings;

/**
* @var \Twig_Environment
* @var Environment
*/
private $twig;

Expand All @@ -51,13 +53,13 @@ class FormSubscriber implements EventSubscriberInterface
* LeadSubscriber constructor.
*
* @param FormActionsSettings $formActionsSettings
* @param \Twig_Environment $twig
* @param Environment $twig
* @param FieldModel $fieldModel
* @param LeadModel $leadModel
*/
public function __construct(
FormActionsSettings $formActionsSettings,
\Twig_Environment $twig,
Environment $twig,
FieldModel $fieldModel,
LeadModel $leadModel
) {
Expand Down Expand Up @@ -104,7 +106,7 @@ public function saveContactField(SubmissionEvent $event)
];

// TWIG filter json_decode
$this->twig->addFilter(new \Twig_SimpleFilter('unescape', function ($string) {
$this->twig->addFilter(new TwigFilter('unescape', function ($string) {
return html_entity_decode($string);
}));

Expand Down

0 comments on commit 46e221a

Please sign in to comment.