Поэтому мне пришлось установить для моего параметра конфигурации 1 и 2 и оставить 0 для требуемого сервиса
class LilworksYoutubeDlExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
$configuration = $this->getConfiguration($configs, $container);
$config = $this->processConfiguration($configuration, $configs);
$definition = $container->getDefinition('lilworks.youtubedl');
$definition->setArgument(1, $config['foo']);
$definition->setArgument(2, $config['bar']);
}
public function getAlias()
{
return 'lilworks_youtubedl';
}
}
В моем services.yml
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="lilworks.youtubedl" class="Lilworks\YoutubeDlBundle\LilworksYoutubeDl" public="true">
<argument type="service" id="kernel" />
</service>
<service id="Lilworks\YoutubeDlBundle\LilworksYoutubeDl" alias="lilworks.youtubedl" public="true"/>
</services>
</container>
И в конструкторерасслоение
class LilworksYoutubeDl
{
private $foo;
private $bar;
private $kernel;
public function __construct(KernelInterface $kernelInterface,$foo,$bar)
{
$this->foo = $foo;
$this->bar = $bar;
$this->kernel = $kernelInterface;
}