Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return output of filterReportsCallable #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
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
11 changes: 6 additions & 5 deletions src/Flare.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,7 @@ public function report(Throwable $throwable, callable $callback = null): ?Report
call_user_func($callback, $report);
}

$this->sendReportToApi($report);

return $report;
return $this->sendReportToApi($report);
}

protected function shouldSendReport(Throwable $throwable): bool
Expand Down Expand Up @@ -240,7 +238,7 @@ public function reportMessage(string $message, string $logLevel, callable $callb
call_user_func($callback, $report);
}

$this->sendReportToApi($report);
return $this->sendReportToApi($report);
}

public function sendTestReport(Throwable $throwable)
Expand All @@ -252,14 +250,17 @@ private function sendReportToApi(Report $report)
{
if ($this->filterReportsCallable) {
if (! call_user_func($this->filterReportsCallable, $report)) {
return;
return null;
}
}

try {
$this->api->report($report);
} catch (Exception $exception) {
return null;
}

return $report;
}

public function reset()
Expand Down