Skip to content

Commit

Permalink
Avoid declaring unnecessary variable
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomartinezbernardo committed Jan 3, 2024
1 parent e7b26a2 commit c592725
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Integrations/Integrations/Slim/SlimIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,13 @@ function ($errorMiddleware, $self, $args) use ($rootSpan, $integration) {
'Slim\\Router',
'lookupRoute',
null,
/** @var \Slim\Interfaces\RouteInterface $return */
function ($router, $scope, $args, $return) use ($rootSpan) {
/** @var \Slim\Interfaces\RouteInterface $route */
$route = $return;
$rootSpan->meta[Tag::HTTP_ROUTE] = $route->getPattern();
$rootSpan->meta[Tag::HTTP_ROUTE] = $return->getPattern();

if (PHP_VERSION_ID < 70000 || dd_trace_env_config("DD_HTTP_SERVER_ROUTE_BASED_NAMING")) {
$rootSpan->resource =
$_SERVER['REQUEST_METHOD'] . ' ' . ($route->getName() ?: $route->getPattern());
$_SERVER['REQUEST_METHOD'] . ' ' . ($return->getName() ?: $return->getPattern());
}
}
);
Expand Down

0 comments on commit c592725

Please sign in to comment.