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.

Source: Wikipedia

To do this we start from the excellent example of refactoring.guru, but going to modify it slightly to fit our purpose.

Continue reading on Medium