Last Wishes is a PHP application written following Domain-Driven Design approach. It's one of the sample applications where you can check the concepts explained in the "Domain-Driven Design in PHP" book.
The LoggerDomainEventSubscriber.php is located in the Domain layer. In addition, it uses functionalities specific to the Infrastructure layer, such as Monolog or Elastica.
Wouldn't it be more appropriate and consistent with the principles dictated by DDD to create a contract (interface) of the Logger in Domain layer, implement it in the Infrastructure layer and then create a subscriber of the domain events in the Application layer?
The LoggerDomainEventSubscriber.php is located in the Domain layer. In addition, it uses functionalities specific to the Infrastructure layer, such as Monolog or Elastica.
Wouldn't it be more appropriate and consistent with the principles dictated by DDD to create a contract (interface) of the Logger in Domain layer, implement it in the Infrastructure layer and then create a subscriber of the domain events in the Application layer?
Thanks in advance 😊