Skip to content

Commit 5e435d1

Browse files
committed
fix: style
1 parent 0936357 commit 5e435d1

File tree

11 files changed

+28
-29
lines changed

11 files changed

+28
-29
lines changed

src/Instrumentation/Laravel/src/Hooks/Illuminate/Contracts/Debug/ExceptionHandler.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@
77
use Exception;
88
use Illuminate\Contracts\Debug\ExceptionHandler as ExceptionHandlerContract;
99
use OpenTelemetry\API\Trace\Span;
10-
use OpenTelemetry\API\Trace\SpanKind;
1110
use OpenTelemetry\API\Trace\StatusCode;
1211
use OpenTelemetry\Context\Context;
1312
use OpenTelemetry\Contrib\Instrumentation\Laravel\Hooks\LaravelHook;
1413
use OpenTelemetry\Contrib\Instrumentation\Laravel\Hooks\LaravelHookTrait;
1514
use function OpenTelemetry\Instrumentation\hook;
16-
use OpenTelemetry\SemConv\TraceAttributes;
1715
use Throwable;
1816

1917
/**
@@ -107,4 +105,4 @@ protected function hookReport(): bool
107105
}
108106
);
109107
}
110-
}
108+
}

src/Instrumentation/Laravel/src/Hooks/Illuminate/Foundation/Http/Middleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,4 @@ protected function hookMiddlewareClass(string $middlewareClass, ?string $group =
182182
}
183183
);
184184
}
185-
}
185+
}

src/Instrumentation/Laravel/src/Hooks/Illuminate/Routing/Route.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use OpenTelemetry\Contrib\Instrumentation\Laravel\Hooks\LaravelHookTrait;
1414
use OpenTelemetry\Contrib\Instrumentation\Laravel\Hooks\PostHookTrait;
1515
use function OpenTelemetry\Instrumentation\hook;
16-
use OpenTelemetry\SemConv\TraceAttributes;
1716
use Throwable;
1817

1918
/**
@@ -111,4 +110,4 @@ protected function hookRun(): bool
111110
}
112111
);
113112
}
114-
}
113+
}

src/Instrumentation/Laravel/src/Hooks/Illuminate/Routing/RouteCollection.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66

77
use Illuminate\Routing\RouteCollection as LaravelRouteCollection;
88
use OpenTelemetry\API\Trace\Span;
9-
use OpenTelemetry\API\Trace\StatusCode;
109
use OpenTelemetry\Context\Context;
1110
use OpenTelemetry\Contrib\Instrumentation\Laravel\Hooks\LaravelHook;
1211
use OpenTelemetry\Contrib\Instrumentation\Laravel\Hooks\LaravelHookTrait;
1312
use function OpenTelemetry\Instrumentation\hook;
14-
use OpenTelemetry\SemConv\TraceAttributes;
1513
use Throwable;
1614

1715
/**
@@ -79,4 +77,4 @@ protected function hookGetRouteForMethods(): bool
7977
}
8078
);
8179
}
82-
}
80+
}

src/Instrumentation/Laravel/src/Hooks/Illuminate/Routing/Router.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace OpenTelemetry\Contrib\Instrumentation\Laravel\Hooks\Illuminate\Routing;
66

7-
use Illuminate\Routing\Router as LaravelRouter;
87
use Illuminate\Routing\RouteCollection;
8+
use Illuminate\Routing\Router as LaravelRouter;
99
use OpenTelemetry\API\Trace\Span;
1010
use OpenTelemetry\API\Trace\StatusCode;
1111
use OpenTelemetry\Context\Context;
@@ -130,4 +130,4 @@ protected function hookRouteCollection(): bool
130130
}
131131
);
132132
}
133-
}
133+
}

src/Instrumentation/Laravel/src/Hooks/Illuminate/View/View.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
namespace OpenTelemetry\Contrib\Instrumentation\Laravel\Hooks\Illuminate\View;
66

77
use Illuminate\View\View as LaravelView;
8-
use OpenTelemetry\API\Trace\Span;
98
use OpenTelemetry\API\Trace\SpanKind;
109
use OpenTelemetry\Context\Context;
1110
use OpenTelemetry\Contrib\Instrumentation\Laravel\Hooks\LaravelHook;
1211
use OpenTelemetry\Contrib\Instrumentation\Laravel\Hooks\LaravelHookTrait;
1312
use OpenTelemetry\Contrib\Instrumentation\Laravel\Hooks\PostHookTrait;
14-
use OpenTelemetry\Contrib\Instrumentation\Laravel\LaravelInstrumentation;
1513
use function OpenTelemetry\Instrumentation\hook;
1614
use OpenTelemetry\SemConv\TraceAttributes;
1715
use Throwable;
@@ -60,4 +58,4 @@ protected function hookRender(): bool
6058
}
6159
);
6260
}
63-
}
61+
}

src/Instrumentation/Laravel/tests/Integration/ExceptionHandler/ExceptionHandlerTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public function test_it_records_exceptions_in_span(): void
7171
$this->assertEquals('Test Exception', $attributes['exception.message']);
7272
$this->assertArrayHasKey('exception.type', $attributes);
7373
$this->assertEquals(Exception::class, $attributes['exception.type']);
74+
7475
break;
7576
}
7677
}
@@ -134,6 +135,7 @@ public function test_it_records_exceptions_during_middleware(): void
134135
$this->assertEquals('Middleware Exception', $attributes['exception.message']);
135136
$this->assertArrayHasKey('exception.type', $attributes);
136137
$this->assertEquals(Exception::class, $attributes['exception.type']);
138+
137139
break;
138140
}
139141
}
@@ -199,6 +201,7 @@ public function getContext(): array
199201
$this->assertArrayHasKey('exception.type', $attributes);
200202
// The class name will be anonymous, so just check it extends Exception
201203
$this->assertStringContainsString('Exception', $attributes['exception.type']);
204+
202205
break;
203206
}
204207
}
@@ -233,4 +236,4 @@ private function router(): Router
233236
/** @psalm-suppress PossiblyNullReference */
234237
return $this->app->make(Router::class);
235238
}
236-
}
239+
}

src/Instrumentation/Laravel/tests/Integration/LaravelInstrumentationTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Illuminate\Support\Facades\DB;
99
use Illuminate\Support\Facades\Http;
1010
use Illuminate\Support\Facades\Log;
11-
use OpenTelemetry\SemConv\TraceAttributes;
1211

1312
/** @psalm-suppress UnusedClass */
1413
class LaravelInstrumentationTest extends TestCase
@@ -68,11 +67,11 @@ public function test_request_response(): void
6867
'server.address' => 'opentelemetry.io',
6968
'server.port' => '',
7069
'http.response.status_code' => 200,
71-
'http.response.body.size' => '21765'
70+
'http.response.body.size' => '21765',
7271
],
73-
'kind' => \OpenTelemetry\API\Trace\SpanKind::KIND_CLIENT
74-
]
75-
]
72+
'kind' => \OpenTelemetry\API\Trace\SpanKind::KIND_CLIENT,
73+
],
74+
],
7675
],
7776
],
7877
],

src/Instrumentation/Laravel/tests/Integration/Middleware/MiddlewareTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Exception;
88
use Illuminate\Routing\Router;
99
use Illuminate\Support\Facades\Route;
10-
use OpenTelemetry\API\Trace\StatusCode;
1110
use OpenTelemetry\Tests\Contrib\Instrumentation\Laravel\Integration\TestCase;
1211

1312
/** @psalm-suppress UnusedClass */
@@ -26,12 +25,13 @@ public function setUp(): void
2625
}
2726

2827
public function test_it_creates_span_for_middleware(): void
29-
{
28+
{
3029
$router = $this->router();
3130
// Define a test middleware
3231
$router->aliasMiddleware('test-middleware', function ($request, $next) {
3332
// Do something in the middleware
3433
$request->attributes->set('middleware_was_here', true);
34+
3535
return $next($request);
3636
});
3737

@@ -375,7 +375,7 @@ public function test_it_handles_middleware_terminate_method(): void
375375
$this->assertEquals(200, $response->status());
376376
$this->assertEquals('Testing terminate middleware', $response->getContent());
377377

378-
// We should have spans now
378+
// We should have spans now
379379
$this->assertGreaterThan(0, count($this->storage));
380380

381381
// The actual assertions here would depend on how terminate middleware is instrumented
@@ -388,4 +388,4 @@ private function router(): Router
388388
/** @psalm-suppress PossiblyNullReference */
389389
return $this->app->make(Router::class);
390390
}
391-
}
391+
}

src/Instrumentation/Laravel/tests/Integration/TestCase.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ protected function assertTraceStructure(array $expectedStructure, string $messag
323323
$count += $countExpectedSpans($child);
324324
}
325325
}
326+
326327
return $count;
327328
};
328329

@@ -387,8 +388,9 @@ protected function assertTraceStructure(array $expectedStructure, string $messag
387388
$this->assertCount(
388389
count($expected['events']),
389390
$actualEvents,
390-
$message ?: sprintf('Expected %d events for span %s, got %d',
391-
count($expected['events']),
391+
$message ?: sprintf(
392+
'Expected %d events for span %s, got %d',
393+
count($expected['events']),
392394
$actual->getSpanId(),
393395
count($actualEvents)
394396
)
@@ -429,8 +431,9 @@ protected function assertTraceStructure(array $expectedStructure, string $messag
429431
$this->assertCount(
430432
count($expected['children']),
431433
$children,
432-
$message ?: sprintf('Expected %d children for span %s, got %d',
433-
count($expected['children']),
434+
$message ?: sprintf(
435+
'Expected %d children for span %s, got %d',
436+
count($expected['children']),
434437
$actual->getSpanId(),
435438
count($children)
436439
)

0 commit comments

Comments
 (0)