1 | <?php |
||
8 | class Api |
||
9 | { |
||
10 | /** @var \Facade\FlareClient\Http\Client */ |
||
11 | private $client; |
||
12 | |||
13 | /** @var bool */ |
||
14 | public static $sendInBatches = true; |
||
15 | |||
16 | /** @var array */ |
||
17 | private $queue = []; |
||
18 | |||
19 | public function __construct(Client $client) |
||
25 | |||
26 | public static function sendReportsInBatches(bool $batchSending = true) |
||
30 | |||
31 | public function report(Report $report) |
||
43 | |||
44 | public function sendTestReport(Report $report) |
||
48 | |||
49 | private function addReportToQueue(Report $report) |
||
53 | |||
54 | public function sendQueuedReports() |
||
66 | |||
67 | private function sendReportToApi(Report $report) |
||
71 | |||
72 | private function truncateReport(array $payload): array |
||
76 | } |
||
77 |