Skip to content

Commit 56a5330

Browse files
committed
Update: event dispatcher deprecated
1 parent ae15044 commit 56a5330

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

Controller/PaymentGatewayController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use IDCI\Bundle\PaymentBundle\Payment\PaymentStatus;
88
use Psr\Log\LoggerInterface;
99
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
10-
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
10+
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
1111
use Symfony\Component\HttpFoundation\JsonResponse;
1212
use Symfony\Component\HttpFoundation\Request;
1313
use Symfony\Component\Routing\Annotation\Route;
@@ -58,7 +58,7 @@ public function callbackAction(Request $request, EventDispatcherInterface $dispa
5858
PaymentStatus::STATUS_UNVERIFIED => TransactionEvent::UNVERIFIED,
5959
];
6060

61-
$dispatcher->dispatch($event[$transaction->getStatus()], new TransactionEvent($transaction));
61+
$dispatcher->dispatch(new TransactionEvent($transaction), $event[$transaction->getStatus()]);
6262

6363
return new JsonResponse($transaction->toArray());
6464
}

Manager/PaymentManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use IDCI\Bundle\PaymentBundle\Payment\PaymentContext;
1111
use IDCI\Bundle\PaymentBundle\Payment\PaymentContextInterface;
1212
use Psr\Log\LoggerInterface;
13-
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
13+
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
1414

1515
class PaymentManager
1616
{

Payment/PaymentContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use IDCI\Bundle\PaymentBundle\Model\PaymentGatewayConfigurationInterface;
99
use IDCI\Bundle\PaymentBundle\Model\Transaction;
1010
use Psr\Log\LoggerInterface;
11-
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
11+
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
1212
use Symfony\Component\HttpFoundation\Request;
1313

1414
class PaymentContext implements PaymentContextInterface
@@ -55,7 +55,7 @@ public function createTransaction(array $parameters): Transaction
5555

5656
$this->transaction = TransactionFactory::getInstance()->create($parameters);
5757

58-
$this->dispatcher->dispatch(TransactionEvent::CREATED, new TransactionEvent($this->transaction));
58+
$this->dispatcher->dispatch(new TransactionEvent($this->transaction), TransactionEvent::CREATED);
5959

6060
return $this->transaction;
6161
}

Step/Event/Action/ManageTransactionStepEventAction.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use IDCI\Bundle\PaymentBundle\Payment\PaymentStatus;
1111
use IDCI\Bundle\StepBundle\Step\Event\Action\AbstractStepEventAction;
1212
use IDCI\Bundle\StepBundle\Step\Event\StepEventInterface;
13-
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
13+
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
1414
use Symfony\Component\HttpFoundation\Request;
1515
use Symfony\Component\HttpFoundation\RequestStack;
1616
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -185,7 +185,7 @@ private function prepareReturnTransaction(StepEventInterface $event, array $para
185185

186186
if (PaymentStatus::STATUS_CREATED === $transaction->getStatus()) {
187187
$transaction->setStatus(PaymentStatus::STATUS_PENDING);
188-
$this->dispatcher->dispatch(TransactionEvent::PENDING, new TransactionEvent($transaction));
188+
$this->dispatcher->dispatch(new TransactionEvent($transaction), TransactionEvent::PENDING);
189189
}
190190

191191
$options = $event->getNavigator()->getCurrentStep()->getOptions();

0 commit comments

Comments
 (0)