Why you should migrate your Symfony configs to PHP
Yesterday, I had a quick discussion on Slack in the Symfony Support channel where somebody was asking about splitting up their services.yaml
file into multiple included files.
This is something I used to do in my own applications, because, to be honest, I had a LOT of YAML configuration and I really needed a way to organise it properly.
Splitting up YAML configs
When you split up configuration across multiple YAML files, you can then include it back into the main file using the following syntax:
So what’s the problem with YAML configuration?
Lets back up for a moment, and consider YAML itself as a configuration file format.
When you configure your Symfony services, it is all based on class name strings. This means your IDE does not necessarily know that a certain string is actually pointing to a specific class in your codebase. Don’t get me wrong, PHPStorm is pretty good at managing this, but in my experience it misses…