Skip to content

send testtrace function for flare:test command#59

Merged
freekmurze merged 6 commits intomainfrom
flare-test-monitoring
Nov 28, 2025
Merged

send testtrace function for flare:test command#59
freekmurze merged 6 commits intomainfrom
flare-test-monitoring

Conversation

@Marcel-Wil
Copy link
Contributor

Accept the test trace and modify its values and send to user

Copy link
Member

@freekmurze freekmurze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, start, but can be improved.

Is it possible to also add tests?

src/Flare.php Outdated
$this->api->testTrace($trace);
}

private function replaceTimestamps(array $data): array
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In open source, we use protected by default.

src/Flare.php Outdated
foreach ($data as $key => $value) {
if ($key === 'startTimeUnixNano') {
$data[$key] = $this->time->getCurrentTime();
} elseif ($key === 'endTimeUnixNano') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O how I dislike else and elseif.

Could you rewrite this could without those keywords. It will probably end up as being more readable.

I guess you can use early returns.

@freekmurze freekmurze merged commit 8b24b05 into main Nov 28, 2025
@freekmurze freekmurze deleted the flare-test-monitoring branch November 28, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants