Skip to content

Commit

Permalink
CS
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric committed Dec 17, 2024
1 parent 51655ba commit 33c9338
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Tracing/PropagationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class PropagationContext
*/
private $dynamicSamplingContext;

/**
/**
* @var float|null
*/
private $sampleRand;

Check failure on line 39 in src/Tracing/PropagationContext.php

View workflow job for this annotation

GitHub Actions / PHPStan

Property Sentry\Tracing\PropagationContext::$sampleRand is never read, only written.
Expand Down
2 changes: 1 addition & 1 deletion src/Tracing/TransactionContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ private static function parseTraceAndBaggage(string $sentryTrace, string $baggag
$context->getMetadata()->setSampleRand(round(mt_rand(0, mt_getrandmax() - 1) / mt_getrandmax() * $samplingContext->get('sample-rate'), 6));

Check failure on line 208 in src/Tracing/TransactionContext.php

View workflow job for this annotation

GitHub Actions / PHPStan

Binary operation "*" between (float|int) and string|null results in an error.
} else {
// [rate, 1]
$context->getMetadata()->setSampleRand(round(mt_rand(0, mt_getrandmax() - 1) / mt_getrandmax() * (1 - $samplingContext->get('sample-rate')) + $samplingContext->get('sample-rate'), 6));
$context->getMetadata()->setSampleRand(round(mt_rand(0, mt_getrandmax() - 1) / mt_getrandmax() * (1 - $samplingContext->get('sample-rate')) + $samplingContext->get('sample-rate'), 6));

Check failure on line 211 in src/Tracing/TransactionContext.php

View workflow job for this annotation

GitHub Actions / PHPStan

Binary operation "+" between (float|int) and string|null results in an error.

Check failure on line 211 in src/Tracing/TransactionContext.php

View workflow job for this annotation

GitHub Actions / PHPStan

Binary operation "-" between 1 and string|null results in an error.
}
} elseif ($context->parentSampled !== null) {
// [0, 1)
Expand Down

0 comments on commit 33c9338

Please sign in to comment.