tuck/converter-bundle
Tuck Converter Bundle integrates the Tuck converter library with Symfony, providing bundle configuration, service definitions, and autowiring for registering and using converters in your application. It helps keep conversion logic reusable and cleanly wired into Symfony's service container.
Install the bundle as a development-only tool and register it only in your dev/test environment:
composer require --dev tuck/converter-bundle
// app/AppKernel.php (Symfony 2.x)
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
$bundles[] = new Tuck\ConverterBundle\TuckConverterBundle();
}
Run app/console list (or bin/console list on Symfony 3+) and locate the converter command. Historically this bundle exposes a command like container:convert. Confirm the exact name and arguments in the README, then inspect Command/ and Resources/config/services.xml to see how loaders/dumpers are wired.
First use case: convert one legacy service file before migrating a bundle:
app/console container:convert app/config/services.xml app/config/services.yml
If the command expects --input/--output options instead, use those. Review the generated file, diff it against the original, and verify the container still compiles before committing.
services.xml to services.yml, run git diff, fix lossy definitions by hand, then repeat for the next file.Definition API. Convert, inspect the generated PHP, then edit it into maintainable code.A -> B -> A and diff the result. If the round trip is clean, you can trust the format change more; if not, inspect tags, aliases, parameters, and factory/configurator definitions.dev environment with as few bundles as possible. Avoid invoking it against a production container build, and never let it overwrite production config directly.XmlFileLoader/YamlFileLoader directly.%parameter%/%env()% placeholders, aliases, tags, visibility, factories, configurators, synthetic/abstract services, and deprecation flags may not survive. Always diff and compile the container afterward..yml, .xml, or .php; otherwise pass explicit format options if the command supports them.lint:yaml for YAML, validate XML against the expected schema, then swap the generated file into a dev kernel and run debug:container / container:debug. Check var/logs/dev.log and use -vvv for command-level errors.var/tmp/ or a scratch directory, compare, and only then move the file into place. Keep the original under version control.How can I help you explore Laravel packages today?