Skip to content

Commit 421ce69

Browse files
authored
Merge pull request #21 from sourceability/fix-style
Fix code style
2 parents 99a8a8a + ed800dd commit 421ce69

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Profiler/DatadogProfiler.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public function __construct(LoggerInterface $logger)
2929
$this->logger = $logger;
3030

3131
$sampleRateString = getenv('DD_TRACE_SAMPLE_RATE');
32-
if(is_numeric($sampleRateString)) {
33-
$sampleRate = floatval($sampleRateString);
32+
if (is_numeric($sampleRateString)) {
33+
$sampleRate = (float) $sampleRateString;
3434
$this->sampleRate = $sampleRate;
3535
}
3636
}
@@ -41,7 +41,7 @@ public function start(string $name, ?string $kind = null): void
4141
return;
4242
}
4343

44-
if($this->rateLimited()) {
44+
if ($this->rateLimited()) {
4545
return;
4646
}
4747

@@ -104,6 +104,7 @@ public function stopAndIgnore(): void
104104
private function rateLimited(): bool
105105
{
106106
$randomFloat = mt_rand() / mt_getrandmax(); // between 0 and 1
107+
107108
return $randomFloat > $this->sampleRate;
108109
}
109110

0 commit comments

Comments
 (0)