wallabag/src/Wallabag/CoreBundle/DependencyInjection/CompilerPass/RegisterWallabagGuzzleSubscribersPass.php
2024-02-02 22:36:27 +01:00

25 lines
831 B
PHP

<?php
namespace Wallabag\CoreBundle\DependencyInjection\CompilerPass;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Wallabag\CoreBundle\Guzzle\FixupMondeDiplomatiqueUriSubscriber;
use Wallabag\CoreBundle\Helper\HttpClientFactory;
class RegisterWallabagGuzzleSubscribersPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
$definition = $container->getDefinition(HttpClientFactory::class);
// manually add subscribers for some websites
$definition->addMethodCall(
'addSubscriber', [
new Reference(FixupMondeDiplomatiqueUriSubscriber::class),
]
);
}
}