Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ final class ErrorHandler
/**
* @var callable|null The previous exception handler, if any
*
* @phpstan-var null|callable(\Throwable): void
* @phpstan-var callable(\Throwable): void|null
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated
*/
private $previousExceptionHandler;

Expand Down
2 changes: 1 addition & 1 deletion src/State/HubAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public function __clone()
/**
* @see https://www.php.net/manual/en/language.oop5.magic.php#object.wakeup
*/
public function __wakeup()
public function __wakeup(): void
{
throw new \BadMethodCallException('Unserializing instances of this class is forbidden.');
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ClientBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

final class ClientBuilderTest extends TestCase
{
public function testGetOptions()
public function testGetOptions(): void
{
$options = new Options();
$clientBuilder = new ClientBuilder($options);
Expand Down
2 changes: 1 addition & 1 deletion tests/ExceptionDataBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class ExceptionDataBagTest extends TestCase
/**
* @dataProvider constructorDataProvider
*/
public function testConstructor(array $constructorArgs, string $expectedType, string $expectedValue, ?Stacktrace $expectedStackTrace, ?ExceptionMechanism $expectedExceptionMechansim)
public function testConstructor(array $constructorArgs, string $expectedType, string $expectedValue, ?Stacktrace $expectedStackTrace, ?ExceptionMechanism $expectedExceptionMechansim): void
{
$exceptionDataBag = new ExceptionDataBag(...$constructorArgs);

Expand Down
6 changes: 3 additions & 3 deletions tests/HttpClient/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

final class ResponseTest extends TestCase
{
public function testResponseSuccess()
public function testResponseSuccess(): void
{
$response = new Response(
200,
Expand All @@ -32,7 +32,7 @@ public function testResponseSuccess()
$this->assertFalse($response->hasError());
}

public function testResponseFailure()
public function testResponseFailure(): void
{
$response = new Response(
500,
Expand All @@ -51,7 +51,7 @@ public function testResponseFailure()
$this->assertTrue($response->hasError());
}

public function testResponseMultiValueHeader()
public function testResponseMultiValueHeader(): void
{
$response = new Response(
200,
Expand Down
4 changes: 2 additions & 2 deletions tests/Metrics/TraceMetricsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function testEnableMetrics(): void
$this->assertEmpty(StubTransport::$events);
}

public function testBeforeSendMetricAltersContent()
public function testBeforeSendMetricAltersContent(): void
{
HubAdapter::getInstance()->bindClient(new Client(new Options([
'before_send_metric' => static function (Metric $metric) {
Expand All @@ -162,7 +162,7 @@ public function testBeforeSendMetricAltersContent()
$this->assertEquals(99999, $metric->getValue());
}

public function testIntType()
public function testIntType(): void
{
traceMetrics()->count('test-count', 2, ['foo' => 'bar']);
traceMetrics()->flush();
Expand Down
4 changes: 2 additions & 2 deletions tests/Monolog/LogsHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function testFiltersAndMapsUsingMonologEnumThreshold($threshold, $recordL
}
}

public function testLogsHandlerDestructor()
public function testLogsHandlerDestructor(): void
{
$transport = new StubTransport();
$client = ClientBuilder::create([
Expand Down Expand Up @@ -135,7 +135,7 @@ public function testOriginTagAppliedWithHandler(): void
$this->assertSame('auto.log.monolog', $log->attributes()->toSimpleArray()['sentry.origin']);
}

public function testOriginTagNotAppliedWhenUsingDirectly()
public function testOriginTagNotAppliedWhenUsingDirectly(): void
{
\Sentry\logger()->info('No origin attribute');

Expand Down
2 changes: 1 addition & 1 deletion tests/OptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ public function excludedPathProviders(): array
/**
* @dataProvider includedPathProviders
*/
public function testIncludedAppPathsOverrideExcludedAppPaths(string $value, string $expected)
public function testIncludedAppPathsOverrideExcludedAppPaths(string $value, string $expected): void
{
$configuration = new Options(['in_app_include' => [$value]]);

Expand Down
2 changes: 1 addition & 1 deletion tests/State/HubAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public static function captureLastErrorDataProvider(): \Generator
];
}

public function testCaptureCheckIn()
public function testCaptureCheckIn(): void
{
$hub = new Hub();

Expand Down
12 changes: 6 additions & 6 deletions tests/Tracing/PropagationContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

final class PropagationContextTest extends TestCase
{
public function testFromDefaults()
public function testFromDefaults(): void
{
$propagationContext = PropagationContext::fromDefaults();

Expand All @@ -27,7 +27,7 @@ public function testFromDefaults()
/**
* @dataProvider tracingDataProvider
*/
public function testFromHeaders(string $sentryTraceHeader, string $baggageHeader, ?TraceId $expectedTraceId, ?SpanId $expectedParentSpanId, ?bool $expectedDynamicSamplingContextFrozen)
public function testFromHeaders(string $sentryTraceHeader, string $baggageHeader, ?TraceId $expectedTraceId, ?SpanId $expectedParentSpanId, ?bool $expectedDynamicSamplingContextFrozen): void
{
$propagationContext = PropagationContext::fromHeaders($sentryTraceHeader, $baggageHeader);

Expand All @@ -49,7 +49,7 @@ public function testFromHeaders(string $sentryTraceHeader, string $baggageHeader
/**
* @dataProvider tracingDataProvider
*/
public function testFromEnvironment(string $sentryTrace, string $baggage, ?TraceId $expectedTraceId, ?SpanId $expectedParentSpanId, ?bool $expectedDynamicSamplingContextFrozen)
public function testFromEnvironment(string $sentryTrace, string $baggage, ?TraceId $expectedTraceId, ?SpanId $expectedParentSpanId, ?bool $expectedDynamicSamplingContextFrozen): void
{
$propagationContext = PropagationContext::fromEnvironment($sentryTrace, $baggage);

Expand Down Expand Up @@ -95,7 +95,7 @@ public static function tracingDataProvider(): iterable
];
}

public function testToTraceparent()
public function testToTraceparent(): void
{
$propagationContext = PropagationContext::fromDefaults();
$propagationContext->setTraceId(new TraceId('566e3688a61d4bc888951642d6f14a19'));
Expand All @@ -104,7 +104,7 @@ public function testToTraceparent()
$this->assertSame('566e3688a61d4bc888951642d6f14a19-566e3688a61d4bc8', $propagationContext->toTraceparent());
}

public function testToBaggage()
public function testToBaggage(): void
{
$dynamicSamplingContext = DynamicSamplingContext::fromHeader('sentry-trace_id=566e3688a61d4bc888951642d6f14a19');
$propagationContext = PropagationContext::fromDefaults();
Expand All @@ -113,7 +113,7 @@ public function testToBaggage()
$this->assertSame('sentry-trace_id=566e3688a61d4bc888951642d6f14a19', $propagationContext->toBaggage());
}

public function testGetTraceContext()
public function testGetTraceContext(): void
{
$propagationContext = PropagationContext::fromDefaults();
$propagationContext->setTraceId(new TraceId('566e3688a61d4bc888951642d6f14a19'));
Expand Down
4 changes: 2 additions & 2 deletions tests/Tracing/TransactionContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testGettersAndSetters(): void
/**
* @dataProvider tracingDataProvider
*/
public function testFromHeaders(string $sentryTraceHeader, string $baggageHeader, ?SpanId $expectedSpanId, ?TraceId $expectedTraceId, ?bool $expectedParentSampled, ?string $expectedDynamicSamplingContextClass, ?bool $expectedDynamicSamplingContextFrozen)
public function testFromHeaders(string $sentryTraceHeader, string $baggageHeader, ?SpanId $expectedSpanId, ?TraceId $expectedTraceId, ?bool $expectedParentSampled, ?string $expectedDynamicSamplingContextClass, ?bool $expectedDynamicSamplingContextFrozen): void
{
$spanContext = TransactionContext::fromHeaders($sentryTraceHeader, $baggageHeader);

Expand All @@ -51,7 +51,7 @@ public function testFromHeaders(string $sentryTraceHeader, string $baggageHeader
/**
* @dataProvider tracingDataProvider
*/
public function testFromEnvironment(string $sentryTrace, string $baggage, ?SpanId $expectedSpanId, ?TraceId $expectedTraceId, ?bool $expectedParentSampled, ?string $expectedDynamicSamplingContextClass, ?bool $expectedDynamicSamplingContextFrozen)
public function testFromEnvironment(string $sentryTrace, string $baggage, ?SpanId $expectedSpanId, ?TraceId $expectedTraceId, ?bool $expectedParentSampled, ?string $expectedDynamicSamplingContextClass, ?bool $expectedDynamicSamplingContextFrozen): void
{
$spanContext = TransactionContext::fromEnvironment($sentryTrace, $baggage);

Expand Down
Loading