src/DependencyInjection/EightPointsGuzzleExtension.php
protected function defineLogMiddleware(ContainerBuilder $container, Definition $handler, string $clientName)
    {
        $logMiddlewareDefinitionName = sprintf('eight_points_guzzle.middleware.log.%s', $clientName);
        $logMiddlewareDefinition = new Definition('%eight_points_guzzle.middleware.log.class%');
        $logMiddlewareDefinition->addArgument(new Reference('eight_points_guzzle.logger'));
        $logMiddlewareDefinition->addArgument(new Reference('eight_points_guzzle.formatter'));
        $logMiddlewareDefinition->setPublic(true);
        $container->setDefinition($logMiddlewareDefinitionName, $logMiddlewareDefinition);

        $logExpression = new Expression(sprintf("service('%s').log()", $logMiddlewareDefinitionName));
        $handler->addMethodCall('push', [$logExpression, 'log']);
    }
protected function defineLogMiddleware(ContainerBuilder $container, Definition $handler, string $clientName)
    {
        $logMiddlewareDefinitionName = sprintf('eight_points_guzzle.middleware.log.%s', $clientName);
        $logMiddlewareDefinition = new Definition('%eight_points_guzzle.middleware.log.class%');
        $logMiddlewareDefinition->addArgument(new Reference('eight_points_guzzle.logger'));
        $logMiddlewareDefinition->addArgument(new Reference('eight_points_guzzle.formatter'));
        $logMiddlewareDefinition->setPublic(true);
        $container->setDefinition($logMiddlewareDefinitionName, $logMiddlewareDefinition);

        $logExpression = new Expression(sprintf("service('%s').log()", $logMiddlewareDefinitionName));
        $handler->addMethodCall('push', [$logExpression, 'log']);
    }
protected function defineLogMiddleware ( ContainerBuilder $ container , Definition $ handler , string $ clientName ) { $ logMiddlewareDefinitionName = sprintf ( 'eight_points_guzzle.middleware.log.%s' , $ clientName ) ; $ logMiddlewareDefinition = new Definition ( '%eight_points_guzzle.middleware.log.class%' ) ; $ logMiddlewareDefinition -> addArgument ( new Reference ( 'eight_points_guzzle.logger' ) ) ; $ logMiddlewareDefinition -> addArgument ( new Reference ( 'eight_points_guzzle.formatter' ) ) ; $ logMiddlewareDefinition -> setPublic ( true ) ; $ container -> setDefinition ( $ logMiddlewareDefinitionName , $ logMiddlewareDefinition ) ; $ logExpression = new Expression ( sprintf ( "service('%s').log()" , $ logMiddlewareDefinitionName ) ) ; $ handler -> addMethodCall ( 'push' , [ $ logExpression , 'log' ] ) ; }
Define Log Middleware for client

@param \Symfony\Component\DependencyInjection\ContainerBuilder $container
@param \Symfony\Component\DependencyInjection\Definition $handler
@param string $clientName

@return void
Define Log Middleware for client