src/DependencyInjection/EightPointsGuzzleExtension.php
protected function defineProfileMiddleware(ContainerBuilder $container, Definition $handler, string $clientName)
    {
        $profileMiddlewareDefinitionName = sprintf('eight_points_guzzle.middleware.profile.%s', $clientName);
        $profileMiddlewareDefinition = new Definition('%eight_points_guzzle.middleware.profile.class%');
        $profileMiddlewareDefinition->addArgument(new Reference('debug.stopwatch'));
        $profileMiddlewareDefinition->setPublic(true);
        $container->setDefinition($profileMiddlewareDefinitionName, $profileMiddlewareDefinition);

        $profileExpression = new Expression(sprintf("service('%s').profile()", $profileMiddlewareDefinitionName));
        $handler->addMethodCall('push', [$profileExpression, 'profile']);
    }
protected function defineProfileMiddleware(ContainerBuilder $container, Definition $handler, string $clientName)
    {
        $profileMiddlewareDefinitionName = sprintf('eight_points_guzzle.middleware.profile.%s', $clientName);
        $profileMiddlewareDefinition = new Definition('%eight_points_guzzle.middleware.profile.class%');
        $profileMiddlewareDefinition->addArgument(new Reference('debug.stopwatch'));
        $profileMiddlewareDefinition->setPublic(true);
        $container->setDefinition($profileMiddlewareDefinitionName, $profileMiddlewareDefinition);

        $profileExpression = new Expression(sprintf("service('%s').profile()", $profileMiddlewareDefinitionName));
        $handler->addMethodCall('push', [$profileExpression, 'profile']);
    }
protected function defineProfileMiddleware ( ContainerBuilder $ container , Definition $ handler , string $ clientName ) { $ profileMiddlewareDefinitionName = sprintf ( 'eight_points_guzzle.middleware.profile.%s' , $ clientName ) ; $ profileMiddlewareDefinition = new Definition ( '%eight_points_guzzle.middleware.profile.class%' ) ; $ profileMiddlewareDefinition -> addArgument ( new Reference ( 'debug.stopwatch' ) ) ; $ profileMiddlewareDefinition -> setPublic ( true ) ; $ container -> setDefinition ( $ profileMiddlewareDefinitionName , $ profileMiddlewareDefinition ) ; $ profileExpression = new Expression ( sprintf ( "service('%s').profile()" , $ profileMiddlewareDefinitionName ) ) ; $ handler -> addMethodCall ( 'push' , [ $ profileExpression , 'profile' ] ) ; }
Define Profile Middleware for client

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

@return void
Define Profile Middleware for client