Run Config Transformer Everyday to keep YAML Away

Have you moved your Symfony configs from YAML to PHP with the help of Config Transformer? Do you use the PHP benefits daily?

But how do you make sure no YAML is leaking from a new developer or in test configs?

We've added a new feature to CI that might help with this.

In recent weeks, we've split Symplify monorepo into standalone packages. A few packages got a new feature in the tidying process.

With Symfony projects upgrades, the first thing we do is move configs from YAML to PHP. That way we can use Rector and PHPStan to help with the full upgrade path.

We've finally removed the last YAML file, and everything is fully blown PHP configuration! Guess what happened on the following PR:

Fatal error: the *.php config file was not found

Damn, there were still a few YAML files in /config and /tests.

Should we check every file? Let CI handle it

Could we run a config transformer, too, to help with this?

vendor/bin/config-transformer config tests --dry-run

Do you want to ensure no YAML file leaks into your code base? Just upgrade to config transformer 12.0 and use it in your CI!


Happy coding!




Do you learn from my contents or use open-source packages like Rector every day?
Consider supporting it on GitHub Sponsors. I'd really appreciate it!