Skip to content

Commit

Permalink
Merge pull request #4 from ostrolucky/eqs-improvements
Browse files Browse the repository at this point in the history
Remove hidden symfony/messenger dependency
  • Loading branch information
rguennichi authored Sep 29, 2024
2 parents c2c9eb9 + 018d4d8 commit ce96692
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

use function Symfony\Component\DependencyInjection\Loader\Configurator\service;

use Symfony\Component\Messenger\Middleware\MiddlewareInterface;

return static function (ContainerConfigurator $container): void {
$services = $container->services();

Expand Down Expand Up @@ -57,7 +59,9 @@
$services->set('check24.new_relic.transaction_name.messenger.message_name', MessageNameStrategy::class);

// Messenger
$services->set('check24.new_relic.messenger_middleware', NewRelicMiddleware::class)->autowire();
if (interface_exists(MiddlewareInterface::class)) {
$services->set('check24.new_relic.messenger_middleware', NewRelicMiddleware::class)->autowire();
}

// Trace ID
$services->set('check24.new_relic.trace_id.uuid_factory', TraceUuidFactory::class)
Expand Down
6 changes: 4 additions & 2 deletions src/DependencyInjection/Check24NewRelicExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ public function load(array $configs, ContainerBuilder $container): void

$container->getDefinition(ConsoleErrorListener::class)
->setArguments(['$excludedExceptions' => $config['excluded_exceptions']]);
$container->getDefinition('check24.new_relic.messenger_middleware')
->setArguments(['$excludedExceptions' => $config['excluded_exceptions']]);
if ($container->hasDefinition('check24.new_relic.messenger_middleware')) {
$container->getDefinition('check24.new_relic.messenger_middleware')
->setArguments(['$excludedExceptions' => $config['excluded_exceptions']]);
}
}
}
2 changes: 1 addition & 1 deletion src/Monolog/Handler/Curl/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static function execute(\CurlHandle $ch, int $retries = 5): bool|string

curl_close($ch);

throw new \RuntimeException(sprintf('Curl error (code %d): %s', $curlErrno, $curlError));
throw new \RuntimeException(\sprintf('Curl error (code %d): %s', $curlErrno, $curlError));
}

continue;
Expand Down

0 comments on commit ce96692

Please sign in to comment.