formatting
This commit is contained in:
parent
a752fb9ecc
commit
99c6c06897
|
|
@ -65,19 +65,6 @@ class HttpStatisticsLogger implements StatisticsLogger
|
|||
return $this->statistics[$appId];
|
||||
}
|
||||
|
||||
protected function getUrl(): string
|
||||
{
|
||||
$action = [WebSocketStatisticsEntriesController::class, 'store'];
|
||||
|
||||
$overridenUrl = config('websockets.statistics.base_url_override');
|
||||
|
||||
if ($overridenUrl) {
|
||||
return $overridenUrl.action($action, [], false);
|
||||
}
|
||||
|
||||
return action($action);
|
||||
}
|
||||
|
||||
public function save()
|
||||
{
|
||||
foreach ($this->statistics as $appId => $statistic) {
|
||||
|
|
@ -92,7 +79,7 @@ class HttpStatisticsLogger implements StatisticsLogger
|
|||
$this
|
||||
->browser
|
||||
->post(
|
||||
$this->getUrl(),
|
||||
$this->storeStatisticsUrl(),
|
||||
['Content-Type' => 'application/json'],
|
||||
stream_for(json_encode($postData))
|
||||
);
|
||||
|
|
@ -101,4 +88,17 @@ class HttpStatisticsLogger implements StatisticsLogger
|
|||
$statistic->reset($currentConnectionCount);
|
||||
}
|
||||
}
|
||||
|
||||
protected function storeStatisticsUrl(): string
|
||||
{
|
||||
$action = [WebSocketStatisticsEntriesController::class, 'store'];
|
||||
|
||||
$overridenUrl = config('websockets.statistics.base_url_override');
|
||||
|
||||
if ($overridenUrl) {
|
||||
return $overridenUrl.action($action, [], false);
|
||||
}
|
||||
|
||||
return action($action);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue