Skip to content

Commit

Permalink
[TASK] Use EventInterface in EventListener
Browse files Browse the repository at this point in the history
Relates: #605
  • Loading branch information
extcode committed Dec 11, 2024
1 parent dd50fd8 commit 72e0c8f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Classes/EventListener/Order/Create/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* LICENSE file that was distributed with this source code.
*/

use Extcode\Cart\Event\Order\CreateEvent;
use Extcode\Cart\Event\Order\EventInterface;
use Extcode\Cart\Event\Order\PersistOrderEvent;
use Psr\EventDispatcher\EventDispatcherInterface;
use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
Expand All @@ -23,7 +23,7 @@ public function __construct(
private readonly PersistenceManager $persistenceManager
) {}

public function __invoke(CreateEvent $event): void
public function __invoke(EventInterface $event): void
{
$settings = $event->getSettings();
$cart = $event->getCart();
Expand Down
4 changes: 2 additions & 2 deletions Classes/EventListener/Order/Finish/ClearCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use Extcode\Cart\Domain\Model\Order\BillingAddress;
use Extcode\Cart\Domain\Model\Order\ShippingAddress;
use Extcode\Cart\Event\Order\FinishEvent;
use Extcode\Cart\Event\Order\EventInterface;
use Extcode\Cart\Service\PaymentMethodsServiceInterface;
use Extcode\Cart\Service\SessionHandler;
use Extcode\Cart\Utility\CartUtility;
Expand All @@ -27,7 +27,7 @@ public function __construct(
protected readonly SessionHandler $sessionHandler
) {}

public function __invoke(FinishEvent $event): void
public function __invoke(EventInterface $event): void
{
$cart = $event->getCart();
$settings = $event->getSettings();
Expand Down
4 changes: 2 additions & 2 deletions Classes/EventListener/Order/Finish/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
*/
use Extcode\Cart\Domain\Model\Cart\Cart;
use Extcode\Cart\Domain\Model\Order\Item;
use Extcode\Cart\Event\Order\FinishEvent;
use Extcode\Cart\Event\Order\EventInterface;
use Extcode\Cart\Service\MailHandler;
use TYPO3\CMS\Core\Utility\GeneralUtility;

class Email
{
protected Cart $cart;

public function __invoke(FinishEvent $event): void
public function __invoke(EventInterface $event): void
{
$this->cart = $event->getCart();
$orderItem = $event->getOrderItem();
Expand Down

0 comments on commit 72e0c8f

Please sign in to comment.