November 21, 2017 Javier Eguiluz

If you've been around the Symfony community for some time, odds are you know and have used the SensioGeneratorBundle. It's a popular bundle (+20 million downloads) that provides console commands to generate boilerplate code, like controllers and entities. It also includes a basic CRUD generator.

Given that SensioGeneratorBundle is starting to show its age and considering the massive simplifications introduced by Symfony 4, we decided to stop evolving that bundle and we've created a new bundle called SymfonyMakerBundle.

SymfonyMakerBundle helps you creating empty commands, controllers, form classes, tests and more so you can forget about the required boilerplate code. It's an alternative to SensioGeneratorBundle for modern Symfony applications and requires using Symfony 3.4 or newer and Symfony Flex.

Of course the end goal is to not have boilerplate code at all in Symfony applications. Symfony 4 made a lot of improvements towards that goal, but you will always have to bootstrap some code, so having a modern, simple and lightweight bundle to do that is nice.

Generating Code with Makers¶ The usage of the bundle is similar to SensioGeneratorBundle, but the commands now use the make: prefix instead of generate: . In this first version of the bundle we've implemented the following makers: 1 2 3 4 5 6 7 8 9 10 11 12 $ php bin/console list make make:command make:controller make:entity make:form make:functional-test make:subscriber make:twig-extension make:unit-test make:validator make:voter Later we'll add more commands, including some interactive makers to generate a Doctrine entity asking for its properties, to generate a form based on a Doctrine entity, etc.