I don't know a way to do that through composer, when you're creating a reusable bundle.
Instead you can configure your bundle based on the config.yml
file, using symfony's Configuration Component, and make those parameters required, this way when you're bundle is installed the user, will have to provide those parameters. For you're use case it will be something like:
// in YourBundle\DependencyInjection\Configuration
public function getConfigTreeBuilder(){
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('your_bundle_alias');
$rootNode
->children()
->scalarNode('param1')->isRequired()->end()
->scalarNode('param1')->isRequired()->end()
->end();
}
// in YourBundle\DependencyInjection\YourExtension
public function load(array $configs, ContainerBuilder $container){
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
// ...
// get the parameters entered in the config file, and configured above
$param1 = $config['param1'];
$param2 = $config['param2'];
// inject them into my_service
$container->getDefinition('my_service')
->setArguments(array($param1, $param2));
// ...
}
Writing your Bundle Configuration this way will force the user to provide an entry for your bundle in the config.yml
file like the following:
your_bundle_alias:
param1: the_users_value
param2: another_value