Description
Description
By default, Symfony loads the configuration files defined in YAML and PHP formats. When creating a new Symfony project, Symfony Flex uses the YAML config files provided in the recipes.
IMO, PHP config files are more convenient than YAML config for the following reasons:
- Better integration in our IDE without any additional plugin
- Deprecations are warned early
- No need to run the code to see errors types in our config files
- Allows you to create dynamic configuration with arrays or config builder
- Our favorite CI tools can watch config files too
The main "drawback" is that config classes are generated in cache when running cache:clear
and those files need to be included in your IDE index.
I think we should encourage devs to use PHP format for config files, and it can start by providing config files in PHP format.
What are your thoughts about this ? Do you write your config files with PHP files ? Why ? Why not ?
I'm opening discussions to get feedback about the use of PHP in config and see if it's relevant or not.
Example
No response