POC of Clean Architecture with Symfony

Introduction I will soon be changing jobs and the clean architecture is used in the new company. So I decided to experiment with it by making a POC.Maybe it can inspire someone. Or could someone help me to correct any errors in my approach. As far as I could understand there are two main approaches… Read More POC of Clean Architecture with Symfony

Implementing Visitor Pattern in PHP and Symfony

In my latest article I showed my implementation of the Pattern Builder with support of Symfony’s Service Tag.I love this Symfony service, and this time I would like to show you how to use it to implement another design pattern: The Visitor pattern, less known than the Builder pattern but also very nice and useful. To do this we… Read More Implementing Visitor Pattern in PHP and Symfony

Implementing Builder Pattern in PHP and Symfony like a boss!

I would like to show you my implementation of the very popular Pattern Builder in PHP using the Symfony framework I will not dwell on this pattern, because there are hundreds of articles that already do this. We can simply say that: Builder is a creational design pattern that lets you construct complex objects step by step.… Read More Implementing Builder Pattern in PHP and Symfony like a boss!

From RabbitMqBundle to PhpEnqueue with Symfony Messenger

Today i try to explain how i migrate from RabbitMqBundle to PhpEnqueue using the Messenger component of Symfony. Stack PHP 7.2 Symfony 4.1 Starting Situation I have well installed RabbitMQ following simple tutorial Symfony 4 and RabbitMQ. So in my configuration file i have the following configuration: #config/packages/old_sound_rabbit_mq.yaml old_sound_rabbit_mq: enable_collector: false connections: default: url: ‘%env(RABBITMQ_URL)%’ lazy:… Read More From RabbitMqBundle to PhpEnqueue with Symfony Messenger

CQRS is easy with Symfony 4 and his Messenger Component

Today i want to show you how to use The Messenger Component of Symfony. Very useful when your project implements the CQRS pattern. With an example, simplicity of use and practicality will be evident. Let’s assume that we have a service like this one: <?php namespace App\Domain\Service\Customer; use App\Domain\Command\Customer\DeleteCustomerCommand; use App\Domain\CommandHandler\Customer\DeleteCustomerCommandHandlerInterface; use App\Domain\Exception\Customer\CriteriaNotAllowedException; use App\Domain\Query\Customer\GetCustomerListQuery; use… Read More CQRS is easy with Symfony 4 and his Messenger Component