• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

FriendsOfOpenTelemetry / opentelemetry-bundle / 12750969892

13 Jan 2025 03:51PM UTC coverage: 88.441% (-0.4%) from 88.791%
12750969892

push

github

web-flow
refactor(DependencyInjection): move configurate in compiler passes (#107)

* refactor(DependencyInjection): move tag configuration in compiler passes

* feat(DependencyInjection): do not instrument services if packages are missing

75 of 98 new or added lines in 11 files covered. (76.53%)

2020 of 2284 relevant lines covered (88.44%)

6.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.5
/src/DependencyInjection/Compiler/MailerInstrumentationPass.php
1
<?php
2

3
namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\DependencyInjection\Compiler;
4

5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\Mailer\MailerInterface;
8
use Symfony\Component\Mailer\Transport\TransportFactoryInterface;
9

10
class MailerInstrumentationPass implements CompilerPassInterface
11
{
12
    public function process(ContainerBuilder $container): void
13
    {
14
        if (true === $container->hasParameter('open_telemetry.instrumentation.mailer.tracing.enabled')
7✔
15
            && true === $container->getParameter('open_telemetry.instrumentation.mailer.tracing.enabled')) {
7✔
16
            return;
1✔
17
        }
18

19
        if (!interface_exists(MailerInterface::class) || !interface_exists(TransportFactoryInterface::class)) {
6✔
NEW
20
            throw new \LogicException('Mailer instrumentation cannot be enabled because the symfony/mailer package is not installed.');
×
21
        }
22

23
        $container->removeDefinition('open_telemetry.instrumentation.mailer.trace.transports');
6✔
24
        $container->removeDefinition('open_telemetry.instrumentation.mailer.trace.default_transport');
6✔
25
        $container->removeDefinition('open_telemetry.instrumentation.mailer.trace.mailer');
6✔
26
    }
27
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc